Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: ftp files from Unix m/c

by simeon2000 (Monk)
on Jul 22, 2002 at 13:21 UTC ( #184031=note: print w/replies, xml ) Need Help??


in reply to Re: ftp files from Unix m/c
in thread ftp files from Unix m/c

I think what the person is asking is how to do a listing, but ignore all of the directory entries in the directory he is reading from.

Frankly, I don't think this could be done with Net::FTP->ls(), AFAIK, because it doesn't give you any bits to determine between dirs and files, and you certainly can't do a grep ! -d  $_, readdir REMOTE_DIR with the FTP module.

Perhaps the easiest way would be to use the Net::FTP->dir command. This will give you an ls -l UNIX long directory list with file permissions and stuff. Then you can probably do a  grep ! /^d/, Net::FTP->dir() instead. Of course, then you have to extract the filename from each line from amidst the other info, but that's not hard.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2023-03-27 17:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (65 votes). Check out past polls.

    Notices?