New feature - text file
| From: | Libor Vaněk | Date: | Mon, 25 Sep 2000 23:52:56 +0000 |
| Subject: | New feature - text file | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33658@lists.php.net to get a copy of this message | ||
Hello,
I have an idea what could be (maybe) really great function in some future release of PHP. One of the
typical algorithms is that you want to change something in text configuration file (like httpd.conf
etc.). When you want to change line you usually read line after line, check if you don't have
the right line, and write to some temporaly file and then delete the old file and rename temporary
one (everybody probably knows this stuff...)
The idea is function like fwriteBACK ($file,$newline) which will REPLACE LAST READED LINE in $file
with $newline. As far as I know, no programming language doesn't have this feature. The
implementation of this function will probably be like as the algorithm written above BUT it will
rapidally increase programming comfort. Yes - it's not very time efecient etc. BUT if you need
some very fast script, just don't use it (this is mainly good for changing configuration files
which you don't do 100x times per second).
I know I could write a library but 1, just now I have no time for that 2, I've discussed with
some other PHP programmers and this will be IMHO so great function to be implemented in standard
PHP.
Libor Vanek,
ICQ: 58504247
email: libor@conet.cz