one of the solutions suggested to me was to lock the file, so i tried flock(), but apparently it does not work the way i need it to. here's the script that i created for the process (lines 3, 4 and 32 show how i use flock):
Code: Select all
$fp = fopen('playlist.inc', 'r');
if (flock($fp, LOCK_EX)) {
while(!feof($fp)) {
useless crap here.
}
flock($fp, LOCK_UN);
}
fclose($fp);
unlink('playlist.inc');the script will still let other scripts access the file while it's reading it. i also get this error:
[client 127.0.0.1] PHP Warning: unlink(playlist.inc) [<a href='function.unlink'>function.unlink</a>]: Permission denied in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\update.php on line 37
which i assume is the actual result of locking the file. i believe this is preventing any writing from being done to the file, but what i need is for any reading to be prevented, as well.