hiii

--000e0ce04940262c2f04a7a19b0b
Content-Type: text/plain; charset=ISO-8859-1

hi all,
any net::ftp commands to get latest file from the directory.

--
Regards,
Narasimha Madineedi

--000e0ce04940262c2f04a7a19b0b--
Narasimha Madineedi [ Sa, 09 Juli 2011 13:54 ] [ ID #2061877 ]

Re: hiii

2011/7/9 Narasimha Madineedi <simha051 [at] gmail.com>:
> hi all,
> any net::ftp commands to get latest file from the directory.
>

won't "ls -ltr" sort the files by date?

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Feng He [ Sa, 09 Juli 2011 14:29 ] [ ID #2061878 ]

Re: hiii

--000e0ce04940e9aa7f04a7ba5376
Content-Type: text/plain; charset=ISO-8859-1

hii i tried ls -ltr but it doesnt work....can u suggest me someother command

On Sat, Jul 9, 2011 at 5:59 PM, Feng He <shorttag [at] gmail.com> wrote:

> 2011/7/9 Narasimha Madineedi <simha051 [at] gmail.com>:
> > hi all,
> > any net::ftp commands to get latest file from the directory.
> >
>
> won't "ls -ltr" sort the files by date?
>



--
Regards,
Narasimha Madineedi

--000e0ce04940e9aa7f04a7ba5376--
Narasimha Madineedi [ So, 10 Juli 2011 19:23 ] [ ID #2061901 ]

Re: hiii

On Sat, Jul 09, 2011 at 05:24:01PM +0530, Narasimha Madineedi wrote:
> hi all,
> any net::ftp commands to get latest file from the directory.
>

You have the hard work yourself:
1. Either use the $ftp->dir() function to get the timestamps, parse it
and find out the latest. A bit unreliable.
2. Better is to use $ftp->ls() to get the list of files, and for each
file, use $ftp->mdtm() to get the modification time, and pick the
latest. mdtm() doesn't work with directories apparently in my ftp
server, so it is useful to skip entries when it doesn't return a
value.

- Sandip


--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Sandip Bhattacharya [ Mo, 11 Juli 2011 09:25 ] [ ID #2061953 ]
Perl » gmane.comp.lang.perl.beginners » hiii

Vorheriges Thema: Creating letter combination generator
Nächstes Thema: understanding adding numeric accumulator