Re: re: Overwriting specific lines in text files without rewritingthe whole thing.

From: Date: Tue, 27 Jun 2000 15:27:03 +0000
Subject: Re: re: Overwriting specific lines in text files without rewritingthe whole thing.
Groups: php.general 
Request: Send a blank email to php-general+get-3352@lists.php.net to get a copy of this message
Bill, Can't you do the same thing in php, using fopen(), fread(), fwrite(), flock(), fclose()? Regards, Carroll Barrett -----Original Message----- From: Bill Rausch <bill@numerical.com> To: John Biesnecker <amraam@ao.net>; php-general@lists.php.net <php-general@lists.php.net> Date: Tuesday, June 27, 2000 10:26 AM Subject: [PHP] re: Overwriting specific lines in text files without rewritingthe whole thing. > >Since your ISP doesn't have MySQL or similar available for you, you might >try writing a small C program that uses open(), lseek(), read(), and >write() to do your "in-place" updating, and then call it from your php >using exec() or system(). The C program itself would be a small one. If >you need to support multiple simultaneous users then you could add "record >locking" or "file locking" so the processes don't interfere with each other. > > open file > find record > get lock > read record > change record > write record > release lock <-- optional since close() does it for you > close file > >Bill >--- > Bill Rausch, Software Development, Unix, Mac, Windows > Numerical Applications, Inc. 509-943-0861 bill@numerical.com > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#3352) next »