![]() |
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; |
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. |
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 11:49 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.