Problem getting shutil.copy() to transfer files to my Web site - ?!
"Martin v. Löwis"
martin at v.loewis.de
Sun Dec 22 13:45:51 EST 2002
Randy Burgess wrote:
> Thanks, Martin. But how can it possibly matter that I don't have
> 'C:\test\test.txt" on the Web server?
When you pass two strings to shutil.copy, the first string denotes the
source file, which must be a valid file name on the system executing
shutil.copy, and must denote an existing file. The second string denotes
the target file, which also must be a valid file name, and must either
denote a non-existing file, or a file that can be written to.
IOW, shutil.copy is like doing cp(1).
There is no reasonable way in which shutil.copy could copy a file on a
from a remote system, unless the remote file system has somehow been
mounted (in which case you still can't use the file name on the remote
system, but must use the file name on the local system).
> After all, when we FTP stuff from a Windows desktop to a Unix server,
> there is no problem with using a Windows-style directory on the
client > side and a Unix-style directory on the server
> side.
When you FTP stuff from a Windows desktop, you have an FTP service
running on the remote system, and you tell the local system to use this
service (by using ftp(1)). When you do cp(1), you are not assuming
anything about a remote system, you are not telling cp which the remote
system is, and cp doesn't support access to remote files, anyway.
Regards,
Martin
More information about the Python-list
mailing list