On Wed, May 16, 2007 at 11:51:50PM +0900, Peter Bailey wrote:
> I need to send some graphics file over to UNIX land, but, without an
> extension. So, I rename the files and try to send them, and, Ruby
> complains that the file isn't there. Why is it that a file rename
> doesn't continue to be legitimate with the original variable name? When
> it's time to "put" the file, Ruby says that the file doesn't exist, I
> guess because it still think that the variable is pointing to the file
> with the extension. What's the point of File.rename if the files can't
> stick with the variable names?

This is bit of a misconception.  The variable "arborfile" in your
snippet is just a String and Strings are immutable.  In this case
arborfile holds as a String the pathname of a file ending in .100.  

The File.rename(old_name,new_name) class method takes 2 Strings,
representing a pathname to the 'old_name' of the on-disk file and the
'new_name' of the on-disk file.  It then moves the on-disk file located
at at the path in 'old_name' and moves it to the path in 'new_name'.  It
does not manipulate the String in 'old_name' or the String in
'new_name'.  

> require 'net/ftp'
> ...
> 

Try:

  Dir.glob("*.100").each do |arborfile|
    new_name = File.basename(arborfile,".100")
    File.rename(arborfile, new_name)
    ftp.putbinaryfile(new_name.downcase)

Or let ftp put it with the new name:

  Dir.glob("*.100").each do |arborfile|
     ftp.putbinaryfile(arborfile,File.basename(arborfile,".100"))

enjoy,

-jeremy

-- 
========================================================================
 Jeremy Hinegardner                              jeremy / hinegardner.org