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 -- I
also have accessed it via lukeftp, i.e. the ftp client that comes with my
FreeBSD and OpenBSD systems here.


The problem seems to be that 'pw = gets' line and I don't understand it. I
have even tried closing the ftp connection before that and reopening it later
but no success.


I'm clueless as to why I'm getting what looks to me like an Errno::ENOENT
exception that references the 'PATH' we Net::FTP#chdir'd to four lines ago.
When all it is doing is calling gets.




Test run:

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 such fi
le or directory - < the path with spaces > (Errno::ENOENT)
        from C:/Documents and Settings/Owner/Desktop/tg.rb:32


Test Code:

  ftp = Net::FTP.new( HOST, USER, PASSWD, ACCT )
  ftp.chdir( PATH )
  ftp.gettextfile( TARGET )
  print( "Password: " )
  pw = gets
  print( "\n" )
  if pw
    # lock it
  else
    # un lock it
  end
  #ftp.puttextfile( TARGET )
  ftp.close
  puts( 'Please restart the server for the changes to take effect' )


end


Can any one give me a point in the right direction?


TerryP.


PS:

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 small
pieces before I begin putting together a 'complete' prototype and finally the
finished program once I am done with testing :-)

And oh yes I do plan on checking out what Ruby offers for Unit Testing in the
future ;-)


--
    
Email and shopping with the feelgood factor!
55% of income to good causes. http://www.ippimail.com