sure - recreate the functionality of 'flock' with new functions... here's some metacode:
// call this function to lock the file for writing, returns 0 if fails
function lockfile() {
if ok_to_write()
create the disk file lock.txt
return 1
else return 0
}
// call this to see if it's ok to write, 0 = you can't proceed
function ok_to_write {
does the file lock.txt exist on disk?
if so return 0
if not return 1
}
function unlock() {
erase the disk file lock.txt
return 1
}
see how it works? call ok_to_write, if that's ok, then lock, do the write, unlock.
if ok_to_write says so, then sleep for one seocnd and do it again.
this is more or less how file locking works. well, in a really meta sense ;-)
best
eric