Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: FTP Module
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FTP Module



Bob Anderson wrote:
> Don't forget Perl. On OSX, Perl comes with a module for FTP.

OSX also provides Python, which has the 'ftplib' module in its standard
library. An example from the docs at
http://docs.python.org/lib/module-ftplib.html:

    >>> from ftplib import FTP
    >>> ftp = FTP('ftp.cwi.nl')   # connect to host, default port
    >>> ftp.login()               # user anonymous, passwd anonymous@
    >>> ftp.retrlines('LIST')     # list directory contents
    total 24418
    drwxrwsr-x   5 ftp-usr  pdmaint     1536 Mar 20 09:48 .
    dr-xr-srwt 105 ftp-usr  pdmaint     1536 Mar 21 14:32 ..
    -rw-r--r--   1 ftp-usr  pdmaint     5305 Mar 20 09:48 INDEX
     .
     .
     .
    >>> ftp.retrbinary('RETR README', open('README', 'wb').write)
    '226 Transfer complete.'
    >>> ftp.quit()

Cheers,
--mlp
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: FTP Module (From: Bob Anderson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.