flock Warning
Posted: Thu Oct 27, 2005 3:54 am
I have a script that reads a text file. The flock is producing an error
Any ideas... I am running PHP 4.3.11?
The script is basic....Warning: flock(): 252 bytes of buffered data lost during conversion to FILE*! in /home/*****/public_html/Link_Manager/admin.php on line 8
Code: Select all
//get file.....
$filename = "http://www.****.com/files/Real_Estate.txt";
$filesize = strlen(file_get_contents("http://www.****.com/files/Real_Estate.txt"));
$fp = fopen ("$filename", "r");
flock($fp, LOCK_EX);//Lock the file
#===============================================================================================
//Loop through
while (!feof ($fp)) {
$link = fgets( $fp, $filesize );
//code here
}
#===============================================================================================
flock($fp, LOCK_UN);// Release the lock
fclose($fp);