Re: copy file over LAN
- From: "Gabriel Genellina" <gagsl-py2@xxxxxxxxxxxx>
- Date: Thu, 27 Mar 2008 03:00:11 -0300
En Thu, 27 Mar 2008 00:34:20 -0300, Astan Chee <stanc@xxxxxxxxx> escribió:
I have a file on another machine on the local network (my machine and
local machines are on windows) and I want to copy it locally. Now the
machine requires authentication and when I try to do a
import shutil
shutil.copy(r'\\remotemachine\c$\temp\filename',r'C:\folder\test.txt')
and it gives me a IOError: [Errno 13] Permission denied: error, which I
expect. How do I provide authentication to copy this file?
Probably there are other ways, but the "net use" command looks easy enough. Execute "net help use | more" in a console to see the right syntax.
Use the subprocess module to run the command from inside Python.
--
Gabriel Genellina
.
- Prev by Date: Re: Line segments, overlap, and bits
- Next by Date: counting using variable length string as base
- Previous by thread: Re: copy file over LAN
- Next by thread: Plugin framework - Overcomplicating things?
- Index(es):
Relevant Pages
|