Re: Detecting open files and forcing closure

2009-01-10 Thread Steven D'Aprano
On Fri, 09 Jan 2009 22:06:03 -0500, Andrew Robert wrote: Is there a way to detect the open files and close them out? You can detect open files by trying to move them and catching the exception when you can't. You may wish to distinguish permission errors. As far as forcing the file to close,

Detecting open files and forcing closure

2009-01-09 Thread Andrew Robert
Hi Everyone, We have a process that does a copy of a share from one location to another. This usually works fine but can occasionally bomb if a file is opened by a user somewhere. Is there a way to code detection of open files and force a close? The files in question are typically PDF files

Re: Detecting open files and forcing closure

2009-01-09 Thread MRAB
Andrew Robert wrote: Hi Everyone, We have a process that does a copy of a share from one location to another. This usually works fine but can occasionally bomb if a file is opened by a user somewhere. Is there a way to code detection of open files and force a close? The files in question are

Re: Detecting open files and forcing closure

2009-01-09 Thread Andrew Robert
MRAB wrote: Andrew Robert wrote: Hi Everyone, We have a process that does a copy of a share from one location to another. This usually works fine but can occasionally bomb if a file is opened by a user somewhere. Is there a way to code detection of open files and force a close? The files in

Re: Detecting open files and forcing closure

2009-01-09 Thread Rhodri James
On Sat, 10 Jan 2009 03:06:03 -, Andrew Robert arob...@townisp.com wrote: The usual scenario is that a user will leave a PDF open and then go home for the evening. They are simply viewing and not modifying the file. When the XCOPY executes, it signals a failure and subsequent scheduler