ok there are things called semaphores... they mean lots of things depending on what/where/when you are using them... but basically it is the solution that is used to block access to shared resources...
if you want to lock a whole directory (or a single file, or a block of memroy) you do this... the file dir.lock in this is considered a semaphore
1 - open up the directory
2 - look for a file called dir.lock
3 - if the file exists, wait
4 - when the file does not exist
5 - create the file
6 - do your dirty work
7 - remove the file dir.lock
this works file assuming your program does not die between creating and destroying the dir.lock file, this can be gotten around by simple ignoring a dir.lock file beyond a certain age. assuming that if it got to be 5 seconds old, whatever process made it must have died, because it shouldn't take 5 seconds.
also this system is voluntary, this only works if everything that is going to use this directory plays by the same rules.
however this should work for the system you described
[edit]
scratch that... i didn't read your post carefully enough, you would have to make your ftp daemon follow these rules also, so i don't think my solution would work...