NAME
FtpDownloadDirectory — Download from remote directory into local directory.
SYNOPSIS
FtpDownloadDirectory FtpHandle Directory OverwritePolicy RecursePolicy DeleteUnmatchedPolicy
DESCRIPTION
Return Value
None.
Arguments
FtpHandleHandle for FTP connection.
DirectoryDirectory to download from / to. Same on remote and local. Use relative path.
OverwritePolicyIf there are local copies with the same name, then when to overwrite them.
Options are: OverwriteAll, RemoteNewer, SizeDifferent, RemoteNewerOrDifferent, RemoteNewerAndDifferent.
RecursePolicyWhether to just handle the files or should also recurse into subdirectories.
Options are: RecurseIntoSubdirectories and NoRecurse.
DeleteUnmatchedPolicyIf at the end, there are local files without any matching remote files, should they be cleaned out or kept.
Options are: DeleteUnmatched and LeaveUnmatched.
More Info
See About FTP Use for additional details.

Local and remote directory have to have the same name. The command will cd into the directory on both ends to start with. Prior to making this call, you can cd and ftp::Cd yourself through the part of the path that is different, and then make the call (see example).

Note that if you want to do mirroring or you want to do the equivalent of a copy-and-paste, there are the FtpMirrorRemoteToLocal and FtpDownloadSite commands.

Currently, there is no way to do the following: both (a) delete all unmatched files and also at the same time (b) leave unmatched directories.

If you set the NoRecurse option and the same directory is on both sides, then that directory will still be considered matched, and so it will not be deleted.


For information regarding exceptions / errors, see here.
EXAMPLES
% set FtpHandle [ftp::Open $IpAddress $Username $Password]
% cd c:/my/local/folder
% ftp::Cd /home/my/directory
% FtpDownloadDirectory $FtpHandle start OverwriteAll RecurseIntoSubdirectories LeaveUnmatched
SEE ALSO
FtpDownloadSite, FtpMirrorToLocal, FtpUploadDirectory
KEYWORDS
file, network