This is my first thread on this mailing list, so bare with me.
I’ve this and it does download TARGET from the FTP server successfully
also have accessed it via lukeftp, i.e. the ftp client that comes with
FreeBSD and OpenBSD systems here.
The problem seems to be that ‘pw = gets’ line and I don’t understand it.
have even tried closing the ftp connection before that and reopening it
but no success.
I’m clueless as to why I’m getting what looks to me like an
exception that references the ‘PATH’ we Net::FTP#chdir’d to four lines
When all it is doing is calling gets.
C:\Documents and Settings\Owner\Desktop>.\tg.rb “path with spaces”
remote_filename ftpsite username passwd
Password: C:/Documents and Settings/Owner/Desktop/tg.rb:32:in `gets’: No
le or directory - < the path with spaces > (Errno::ENOENT)
from C:/Documents and Settings/Owner/Desktop/tg.rb:32
ftp = Net::FTP.new( HOST, USER, PASSWD, ACCT )
ftp.chdir( PATH )
ftp.gettextfile( TARGET )
print( "Password: " )
pw = gets
print( “\n” )
# lock it
# un lock it
end #ftp.puttextfile( TARGET )
puts( ‘Please restart the server for the changes to take effect’ )
Can any one give me a point in the right direction?
For any one who is interested in the shotty appearance of the test code.
I do build case prototypes as I go along. So I can test things out in
pieces before I begin putting together a ‘complete’ prototype and
finished program once I am done with testing
And oh yes I do plan on checking out what Ruby offers for Unit Testing
I’m sorry, maybe I’m a little slow, but isn’t “Returns (and assigns to
next line from the list of files in ARGV (or $*), or from standard input
no files are present on the command line.” basically what I said?
Or are you refering to the fact that my phrasing made it sound as if
cared about the first command line parameter?