Lock file via PHP so shell script cannot access it
Posted: Tue Oct 17, 2006 8:12 am
I have a php process that is called every few minutes to pull values from a database and it writes these values to a file. The values in the file are included by a ksh script, but I want to make sure that while the process is writing the file the ksh script does not pick up the file for execution.
Something like this:
Database <---PULL---> Process.php ----> FILEA <---READ--- script.ksh
I need to be sure that while process.php is writing to FILEA script.ksh can't execute FILEA. I read a bit about flock() and some other things, but I'm not sure if this will lock it at the OS level so script.ksh script can't access. Any help would be much appreciated!
Thanks
James
Something like this:
Database <---PULL---> Process.php ----> FILEA <---READ--- script.ksh
I need to be sure that while process.php is writing to FILEA script.ksh can't execute FILEA. I read a bit about flock() and some other things, but I'm not sure if this will lock it at the OS level so script.ksh script can't access. Any help would be much appreciated!
Thanks
James