note 37169 deleted from function.fwrite by didou
| From: | didou@php.net | Date: | Wed, 05 Nov 2003 16:59:24 +0000 |
| Subject: | note 37169 deleted from function.fwrite by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59953@lists.php.net to get a copy of this message | ||
Note Submitter: david@amoureux.com
----
English:
If you want to rewrite a very used text file (for a chat...), you've got some time a empty file
(one of your users read the file while a other is writing).
I resolved this problem with -rename-
rename use a temp file and replace the target without delay.
So... write to a other file and replace the main file with rename.
French:
Si vous voulez mettre à jour un fichier texte très utilisé (pour un chat...), il arrive que
celui-ci soit écrasé (une utilisateur lit le fichier pendant que l'autre écrit dessus).
J'ai résolu le problème en utilisant la commande -rename-
rename utilise un fichier temporaire et remplace la cible sans délais.
Donc... Ecrivez sur un autre fichier et remplace le fichier principal avec rename.