Ragazzi io ho un file dat molto grande....qualcuno sa degli algoritmi per effettuare un inserimento e una modifica di un record in questo file?? io su internet non riesco a trovare niente.....

posto il codice del ciclo ke ho fatto per stampare tutto il file.....così se mai qualkuno può capire un po' quello ke ho imparato ed il modo che ho su come utilizzare questo file... thanks

// 14 Novembre 2006 Esercizio per prova01.dat (i/o file binari)
# prova file di record (class)
class prova03 {
var $OrderID = "";
var $CustomerID = "";
var $EmployeeID = "";
var $OrderDate = "";
var $RequiredDate = "";
var $ShippedDate = "";
var $ShipVia = "";
var $Freight = "";
var $ShipName = "";
var $ShipAddress = "";
var $ShipCity = "";
var $ShipRegion = "";
var $ShipPostalCode = "";
var $ShipCountry = "";

};
$rec = new prova03; // definizione variabile


function print_record($rec)
{
static $i=0;
printf("<tr><td> %3d",++$i);
printf("<td> %s <td> %s <td> %s \n",$rec->OrderID,$rec->CustomerID,$rec->EmployeeID);
printf("<td> %s <td> %s <td> %s \n",$rec->OrderDate,$rec->RequiredDate,$rec->ShippedDate);
printf("<td> %s <td> %s <td> %s \n",$rec->ShipVia,$rec->Freight,$rec->ShipName);
printf("<td> %s <td> %s <td> %s \n",$rec->ShipAddress,$rec->ShipCity,$rec->ShipRegion);
printf("<td> %s <td> %s <td> \n",$rec->ShipPostalCode,$rec->ShipCountry);

//echo("<tr>");

}

function load_record(& $rec,$fd) // passaggio per indirizzo di $rec
{


$rec->OrderID =fread($fd,12);
if (feof($fd)) // qui e non sopra perche' se no ne leggo 1 in piu'
return 0;
$rec->CustomerID = fread($fd,11);
$rec->EmployeeID = fread($fd,12);
$rec->OrderDate = fread($fd,55);
$rec->RequiredDate = fread($fd,55);
$rec->ShippedDate = fread($fd,55);
$rec->ShipVia = fread($fd,12);
$rec->Freight = fread($fd,22);
$rec->ShipName = fread($fd,41);
$rec->ShipAddress = fread($fd,61);
$rec->ShipCity = fread($fd,16);
$rec->ShipRegion = fread($fd,16);
$rec->ShipPostalCode = fread($fd,15);
$rec->ShipCountry = fread($fd,17);
return 1;
}

$fd=fopen("prova03.dat","rb");
printf("<html><body bgcolor=\"#00CCFF\"> <h2> <CENTER> OUTPUT ARCHIVIO </h2>\n");
echo ("<table Border=1 CENTER> \n <th> Numero <th> OrderID <th> CustomerID <th> EmployeeID <th> OrderDate <th> RequiredDate <th> ShippedDate <th>");
echo ("ShipVia <th> Freight <th> ShipName <th> ShipAddress <th> ShipCity <th> ShipRegion <th> ShipPostalCode <th> ShipCountry </th>");
while ( load_record($rec,$fd) )
print_record($rec);
printf("</table> </h2></body></html>\n");
fclose($fd);
invece di stampare come posso fare a modificare un elemento del file, ed inserirne uno nuovo.. anche se nn c'è il codice anke della documentazione.... grazie....