Hi,
Saturday, March 15, 2003, 4:53:44 AM, you wrote:
RP> Yes I did.
RP> Here is the code, maybe I am just missing something (this is the part
RP> where it writes and then opens again...
RP> $h6 = fopen("/etc/group.backup","a");
RP> for($i = 0; $i < count($users); $i++)
RP> {
RP> for($k = 0; $k < count($grouplines);$k++)
RP> {
RP> $groupline = explode(":", $grouplines[$k]);
RP> if($groupline[0] == $users[$i])
RP> continue 2;
RP> }
RP> $line = $users[$i] . ":x:" . ($user_ids[$i]+1000) .
RP> ":\n";
RP> fwrite($h6, $line);
RP> }
RP> fclose($h6);
RP> //have to re read the group file since we just modified it
RP> $h7 = fopen("/etc/group.backup","r");
RP> $groupcontent = fread($h7,filesize("/etc/group.backup"));
RP> fclose($h7);
RP> If I output the filesize("/etc/group.backup") after h6 is closed it is 0
RP> even though it is not.
RP> Ron
RP> On Fri, 2003-03-14 at 12:15, Chris Hayes wrote:
>> At 18:53 14-3-2003, you wrote:
>> >I open a file, modify it, save it out to disk. The VERY next line, i
>> >open it, and the size is zero. I look at the file and it is fine (not
>> >zero).
>> >
>> >I think there is a timing issue with php on file read/writes. I tried
>> >sleep(1), but all that did was slow the script down (didn't help).
>> >
>> un-educated guess:
>> did you try fclose then fopen again?
>>
>>
You could try clearstatcache() after the fclose.
Although the fopen,close is not listed in the affected files you never know...
--
regards,
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php