Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Net::MirrorDir help

by sunnyfedora99 (Novice)
on Nov 17, 2011 at 10:54 UTC ( #938588=note: print w/ replies, xml ) Need Help??


in reply to Re: Net::MirrorDir help
in thread Net::MirrorDir help

Setting Debug to 1 gives me the following output of the 'readdir'

returnvalues from <dir(/dir3)> -rw-r----- 1 ftp ftp 420730 Nov 17 10:38 file with spac +e.pdf -rw-r----- 1 ftp ftp 956 Nov 16 16:33 mail.txt

But when it shows the file which doesn't match it show the following:

/dir3/space.pdf...

I've opened up a bug case, to get this issue fixed.


Comment on Re^2: Net::MirrorDir help
Select or Download Code
Re^3: Net::MirrorDir help
by Corion (Pope) on Nov 17, 2011 at 11:03 UTC

    A cursory glance at the module source reveals this gem:

    ... for my $line (@{$ra_lines}) { @info = split(/\s+/, $line); $name = $info[$#info]; ...

    So yes, filenames containing spaces are broken. A potential fix might be

    @info = split(/\s+/, $line, 9); # 9 columns in FTP output

    ... if one could be sure that each FTP server would return 9 columns of output. Another alternative could be to rely on the file date/time as a marker, or to try a fixed width parser for the ftp output, and checking that split /\s+/ always returns the same number of items.

Re^3: Net::MirrorDir help
by toolic (Bishop) on Nov 17, 2011 at 15:04 UTC
    Here is a quote from the "Changes" file...
    0.14 Sat Feb 23 10:36:50 2008 - using the function "$self->{_connection}->dir($dir)" to the sea +rch of the directory the FTP-server should return the following format as response of +the LIST command: -r--r--r-- 1 ftpuser ftpusers 576 Feb 23 09:23 file.txt drwxrwxr-x 2 ftpuser ftpusers 512 Feb 21 13:54 Dir1 Directory- or filenames should not contain any white space. - add some tests
    It looks like the author was aware of the limitation.

      Ahhh, i've just seen that too. I've opened a case anyways, would be good to get that fixed.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938588]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2015-07-06 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (73 votes), past polls