D
Daniel Berger
Hi all,
Ruby 1.8.5
I'm hitting some odd behavior with Net::FTP.new. I'm connecting to a
Win2k3 server (running IIS 6, if that matters). The directory style is
set to "UNIX", and the ftp server is in passive mode.
I'm trying to "put" a simple text file. When I use the block form of
FTP.new nothing happens. No error, but the text file is not ftp'd to
the remote machine. When I use the non-block form, everything works
fine.
Sampe script:
# This fails
require "net/ftp"
include Net
file = "test.txt"
FTP.new(host){ |ftp|
ftp.passive = true
ftp.login(user, pass)
ftp.chdir(dir)
ftp.put(file)
}
However, this snippet works just fine:
ftp = FTP.new(host)
ftp.passive = true
ftp.login(user, pass)
ftp.chdir(dir)
ftp.put(file)
ftp.close
Note that the "ftp.passive = true" had no effect one way or another.
Looking at the source code for Net::FTP revealed nothing out of the
ordinary. I ran the same script from both a Linux machine and a
Windows XP box and got the same behavior, so I don't think it's a line
ending issue.
Has anyone seen this before?
Thanks,
Dan
Ruby 1.8.5
I'm hitting some odd behavior with Net::FTP.new. I'm connecting to a
Win2k3 server (running IIS 6, if that matters). The directory style is
set to "UNIX", and the ftp server is in passive mode.
I'm trying to "put" a simple text file. When I use the block form of
FTP.new nothing happens. No error, but the text file is not ftp'd to
the remote machine. When I use the non-block form, everything works
fine.
Sampe script:
# This fails
require "net/ftp"
include Net
file = "test.txt"
FTP.new(host){ |ftp|
ftp.passive = true
ftp.login(user, pass)
ftp.chdir(dir)
ftp.put(file)
}
However, this snippet works just fine:
ftp = FTP.new(host)
ftp.passive = true
ftp.login(user, pass)
ftp.chdir(dir)
ftp.put(file)
ftp.close
Note that the "ftp.passive = true" had no effect one way or another.
Looking at the source code for Net::FTP revealed nothing out of the
ordinary. I ran the same script from both a Linux machine and a
Windows XP box and got the same behavior, so I don't think it's a line
ending issue.
Has anyone seen this before?
Thanks,
Dan