Yes I did.
Here is the code, maybe I am just missing something (this is the part
where it writes and then opens again...
$h6 = fopen("/etc/group.backup","a");
for($i = 0; $i < count($users); $i++)
{
for($k = 0; $k < count($grouplines);$k++)
{
$groupline = explode(":", $grouplines[$k]);
if($groupline[0] == $users[$i])
continue 2;
}
$line = $users[$i] . ":x:" . ($user_ids[$i]+1000) .
":\n";
fwrite($h6, $line);
}
fclose($h6);
//have to re read the group file since we just modified it
$h7 = fopen("/etc/group.backup","r");
$groupcontent = fread($h7,filesize("/etc/group.backup"));
fclose($h7);
If I output the filesize("/etc/group.backup") after h6 is closed it is 0
even though it is not.
Ron
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?
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php