Dan Muey wrote:

> > Bob Showalter wrote:
> >
> > > Johnson, Shaunn wrote:
> > > > Howdy:
> > > >
> > > > I'm looking for information that will let me
> > > > open an ftp connection and grep / search
> > > > for files and then FTP them back to me.
> > >
> > > What do you mean "grep/search" for files? If you want to search for
> > > particular file *names*, Net::FTP can return a list of files and
> > > directories you can examine.
> >
> > True, but it is an inadequately documented feature of the
> > module.  The pod indicates only an optional DIR parameter for
> > the ls function:
> >
> >     ls ( [ DIR ] )
> >         Get a directory listing of "DIR", or the current directory.
> >
> >         In an array context, returns a list of lines returned from the
> >         server. In a scalar context, returns a reference to a list.
> >
> > But the following:
> >
> > my @files = $ftp->ls("*.jpg");
>
> Since there is noe directory '*.jpg' it just does the ls on the cwd.

Yeppers.

> So DIR is a directory, /images for instance

Nope.  The directory being queried contains 50-100 files, of all types.

>
> It looks like you are trying to ls jpg files but this isn't grep and the regex isn't 
> even right, it looks more like a winders type thing.

The directory is on a Linux web-server.
The OP was concerned with fileglobbing through the Net::FTP ls function, not grep.

Dan, it works.

Joseph




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to