Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net::FTP - error finding files with spaces

Status
Not open for further replies.

bigbalbossa

Programmer
Mar 21, 2002
87
US
Hi All,

I have a script that reads a flat file containing only filenames, then does a listing on those files to see if they exist on the server...but it's choking on files with spaces in name. I've tried about everything i can think of to no avail.

Just using the normal ftp login and then:

my $temp = $ftp->ls( "$file" )

if $file has no spaces, i'm ok. Thoughts?
 
Net::FTP allows spaces just fine in the examples that I tried.

I would therefore suspect that it has something to do with your specific environment (ftp server), or possibly some syntax or logic error in your construction of $file.

Sorry I can't be more helpful.
 
spaces in filenames is not kosher, you may need to replace them with %20:

Code:
$file =~ s/\s/%20/g;
my $temp = $ftp->ls($file)



- Kevin, perl coder unexceptional!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top