[python-win32] Re: Determine file being accessed

Roger Upole rwupole at msn.com
Sat Jan 29 01:13:27 CET 2005


You get permission denied if you try to move a file
while it's being written to, so you could just keep on trying
to move it until you succeed.  I actually had to do this
once, and it worked very reliably.

       Roger


"Neil Benn" <benn at cenix-bioscience.com> wrote:
> Hello,
> 
>          I have a job where I need to move a file on a trigger from 
> another program, however this program may or may not have finished 
> writing to the file when I need to move it (I have no way of changing 
> this behavior).  Therefore I need to determine if a file is still being 
> written to, this is on a windows XP box.
> 
>    Does anyone know of a way to determine this using python (I'd prefer 
> to use python as my company is a python shop and using anything else 
> will create support issues)?
> 
>    Thanks, in advance for your help.
> 
> Cheers,
> 
> Neil



More information about the Python-win32 mailing list