ftp recursively

Paul Rubin http
Thu Mar 20 08:07:00 CET 2008


Jeff Schwab <jeff at schwabcenter.com> writes:
> I thought os.walk was for locally mounted directories...  How is it
> relevant on remote filesystems?

Yes, os.walk is for local directories.  I thought you wanted to push a
local tree to a remote host.  For pulling, yes, you need to do
something different; for example, rsync can handle it for you.

> Don't shoot the messenger, but you're severely confused here.  Whether
> you're using ftp, rcp, or rsync is a completely separate issue to
> whether you're running over ssl (which I assume you meant by ssh).

SSL would make more sense but ssh is more commonly used.

> FTP is a work-horse protocol for transferring files.  It's going to be
> with us for a long, long time. 

Here's what happened when I just tried to use it:

    $ ftp localhost
    ftp: connect: Connection refused
    ftp> 

That is quite common these days.  I think ftp doesn't play nicely with
encryption tunnels because of the way it uses a separate port for out
of band signalling, but I never paid close attention, so maybe there's
some other issue with it.  I can't think of when the last time was
that I actually used ftp.

> The point of rsync is to keep a local directory tree in sync with a
> remote one, by transferring only change-sets that are conceptually
> similar to patches.  If you're only transferring files once, there's
> no particular benefit (AFAIK) to using rsync rather than some kind of
> recursive ftp.

One benefit is that it handles the recursion for you by itself.
Another is that in modern unix environments it's more likely to work
at all (i.e. if there is no ftp server at the target machine).



More information about the Python-list mailing list