Hello all,
 
I am accessing a filesystem from different servers over NFS. Now i want to lock files while i access them (using flock). Now i have one problem, flock only works on a filehandle. Most of the time I dont have access to a filehandle because the filesystem access is handled in a module.
 
I do know the filename that has to be locked, but i am not using a filehandle. Is there a way for me to lock the file anyway? The only way i can think of is opening a temp filehandle on the file, lock it, do the file operations and then close the filehandle again. This looks a bit dirty to me and i don't know if there are any caveats with this method.
 
Anyone that can offer me some advise on this?
 
Thank you,
 
Merijn

Reply via email to