Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   ftp a file by date and name match (http://www.velocityreviews.com/forums/t319382-ftp-a-file-by-date-and-name-match.html)

Bob 07-08-2003 02:29 PM

ftp a file by date and name match
 
I am trying to get the latest file from an ftp site that matches a
pattern and is the latest one. I have it in Perl and would like to see
the Python version for comparison.

Perl version:

# this matches the name only by looking at files
# that start with 8 numbers (i.e. 20021203)
foreach(@list) {
if(m/\d{8}.*x86.exe/) {
push(@match,$_)
}
}

if(scalar(@match)) {
my $file=$match[$#match];
$ftp->binary();
$ftp->get($file);
}
$ftp->quit;

Bob X 07-09-2003 12:06 AM

Re: ftp a file by date and name match
 
"John Hunter" <jdhunter@ace.bsd.uchicago.edu> wrote in message
news:mailman.1057683552.18026.python-list@python.org...
> >>>>> "Bob" == Bob <bobx@linuxmail.org> writes:

> Perhaps you'll join the ranks of the converted?
>
> JDH


Perhaps! I am looking forward to 2.3.



Bob 07-10-2003 04:33 PM

Re: ftp a file by date and name match
 
John Hunter <jdhunter@ace.bsd.uchicago.edu> wrote in message news:<mailman.1057683552.18026.python-list@python.org>...
> >>>>> "Bob" == Bob <bobx@linuxmail.org> writes:

>
> Perhaps you'll join the ranks of the converted?


Mayhaps. : )

The only problem I am having is that I do NOT know the name of the
file to match, only the pattern of the file name.


All times are GMT. The time now is 03:30 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.