win32 How to make sure a file is completely written?

2009-05-11 Thread justind
Hello, I'm using http://code.activestate.com/recipes/156178/ to watch a folder in windows. It's working perfectly, but sometimes when I try to open the file immediately after receiving the event, it's not ready to be opened--if I try to open it with PIL I get IOError: cannot identify image file

Re: win32 How to make sure a file is completely written?

2009-05-11 Thread ma
You have to wait until IO is ready. In Unix, we accomplish this with fcntl and the default signal SIGIO, I am not sure how you would do this in Windows. On Mon, May 11, 2009 at 9:51 AM, justind justin.don...@gmail.com wrote: Hello, I'm using http://code.activestate.com/recipes/156178/ to

Re: win32 How to make sure a file is completely written?

2009-05-11 Thread Tim Golden
justind wrote: Hello, I'm using http://code.activestate.com/recipes/156178/ to watch a folder in windows. Wow, that takes me back. There's a bit more info (and a different technique) here if you're interested: http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html

Re: win32 How to make sure a file is completely written?

2009-05-11 Thread justind
On May 11, 10:03 am, Tim Golden m...@timgolden.me.uk wrote: justind wrote: Hello, I'm usinghttp://code.activestate.com/recipes/156178/to watch a folder in windows. Wow, that takes me back. There's a bit more info (and a different technique) here if you're interested: