Connecting Tech Pros Worldwide Help | Site Map

Re: Distinguish file and folder on ftp site

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 21st, 2008, 11:05 AM
Mailing List SVR
Guest
 
Posts: n/a
Default Re: Distinguish file and folder on ftp site

Il giorno gio, 14/08/2008 alle 10.08 +0200, Fredrik Lundh ha scritto:
Quote:
Mailing List SVR wrote:
>
Quote:
is there a simple way to do this?

ftplib seems unable to distinguish between files and dir, a mimetype
check would be good,
>
the FTP protocol doesn't specify the format for the output from the LIST
command, so you have to use some heuristics; see e.g. the code in
>
http://svn.python.org/projects/pytho...s/ftpmirror.py
>
or use a wrapper for Dan Bernstein's ftpparse library (requires a C
compiler):
>
http://cr.yp.to/ftpparse.html
http://c0re.23.nu/c0de/ftpparsemodule/
http://effbot.org/downloads/#ftpparse
>
ftpparse seems broken, I found ftputil as the best solution,

thanks
Nicola
Quote:
Not sure what you mean by "mimetype"; that has nothing to do with
directories vs. files, afaik.
>
</F>
>
--
http://mail.python.org/mailman/listinfo/python-list

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.