Drop folder and race conditions

Larry Bates larry.bates at websafe.com
Tue Oct 9 08:05:57 EDT 2007


I have a need to implement a drop folder upload mechanism for secure uploading 
of files to a server.  At first glance this appears that it would be an easy 
application to write.  Then I begin to think about the race conditions that 
exist between the process that will wake up to upload the files and the fact 
that the user can add additional files to the drop folder at any point in time.
I would like to clear out files/folders after they have been processed but it is 
possible that while the background process was uploading files, the user added 
additional files/folders to the drop folder that make the deletion of folders 
impossible.  This project has become significantly more complex than it appeared 
at first.  Anyone out there have any "sage" advice on how to tackle this beast?

Thanks in advance for any pointers.

Regards,
Larry Bates



More information about the Python-list mailing list