Re: re: Overwriting specific lines in text files without rewriting the whole thing.
| From: | John Biesnecker | Date: | Tue, 27 Jun 2000 15:06:50 +0000 |
| Subject: | Re: re: Overwriting specific lines in text files without rewriting the whole thing. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3350@lists.php.net to get a copy of this message | ||
Thanks. That's a really good idea.
John Biesnecker
amraam@ao.net
On Tue, 27 Jun 2000, Bill Rausch wrote:
>
> 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
>