copy locked files

rubbishemail at web.de rubbishemail at web.de
Mon Jun 18 13:05:56 EDT 2007


Hi Adam,



On 18 Jun., 18:41, "Adam Pletcher" <a... at volition-inc.com> wrote:
> Do you mean files marked in-use by the OS, like DLLs used by an open
> application?
I dont know the exact name, but some programs totally lock the files,
like Visual Studio

shutil.copy('C:\\a\\test\\test.ncb','C:\\b\test.ncb')

IOError: [Errno 13] Permission denied: 'C:\\a\\test\\test.ncb'

As soon as I quit the application I can copy the file.

(I am writing a backup software which saves the changed files every
few minutes. If there was a slight possibility
to copy a file which is written at the same moment and therefore not
consistent this is still better than no backup)

>
> There shouldn't be anything preventing you from copying in-use files, or
> even read-only files if that's what you meant:

That's exactly my opinion!


>
> Although you can't move or delete an in-use file, AFAIK.
this seems to be easier, you can use inuse.exe
http://support.microsoft.com/kb/228930/en-us


Daniel




More information about the Python-list mailing list