How I Can The pointer for the file is updated during the execution?
| From: | Santhyago Bueno Gallao | Date: | Mon, 08 Jan 2001 14:02:22 +0000 |
| Subject: | How I Can The pointer for the file is updated during the execution? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-33221@lists.php.net to get a copy of this message | ||
Hi,
I need a function or a way of doing with that the pointer for the file
is updated during the execution of the program. Below it is
the code of the program that I am doing, if they have a better idea to
do him to work I thank.
//------------------------------------------------------------------------------------------------------------------------------------
<html>
<body>
<?PHP
$ok = file("ok.dat");
$users = file("users.dat");
$aux = file("faltam.dat"); <--
$faltam = fopen("faltam.dat","a"); <--
$existe = 0;
$tamOk = count($ok); echo $tamOk."<br>";
$tamUsers = count($users); echo $tamUsers."<br>";
for ($i = 0; $i < $tamUsers; $i++) {
$tempUsers = split("#", $users[$i]);
echo "I = ".$i."<br>";
for ($j = 0; $j < $tamOk; $j++) {
$tempOk = split("#", $ok[$j]);
echo "J = ".$j."<br>";
if (strtoupper($tempOk[0]) != strtoupper($tempUsers[0])) {
$aux = file("faltam.dat"); // <-- Here is the point that I need
update
$tamAux = count($aux); echo $tamAux."<br>";
for ($k = 0; $k < $tamAux; $k++) {
$tempFaltam = split("#", $aux[$k]);
echo "K = ".$k."<br>";
if (strtoupper($tempOk[0]) != strtoupper($tempFaltam[0]))
$existe = 1;
}
if ($existe == 1) {
$existe = 0;
$linha = $tempUsers[0]."#".$tempUsers[1]."#".$tempUsers[2];
echo $linha."<br>";
fwrite($faltam, $linha);
}
}
}
}
?>
</body>
</html>
//--------------------------------------------------------------------------------------------------------------------------------------
Santhyago