Re: Set text file to 0K before writing
| From: | Lars Torben Wilson | Date: | Sun, 10 Sep 2000 23:09:58 +0000 |
| Subject: | Re: Set text file to 0K before writing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16093@lists.php.net to get a copy of this message | ||
Hotchilli Support writes:
> What's the quickest way to set a text file back to 0K before writing
> (without deleting and recreating it)?
>
> Thanks
>
> Tony
From the manual entry for fopen():
---------------------------------------
mode may be any of the following:
'r' - Open for reading only; place the file pointer at the
beginning of the file.
'r+' - Open for reading and writing; place the file pointer at the
beginning of the file.
'w' - Open for writing only; place the file pointer at the
beginning of the file and truncate the file to zero length.
If the file does not exist, attempt to create it.
'w+' - Open for reading and writing; place the file pointer at the
beginning of the file and truncate the file to
zero length. If the file does not exist, attempt to create it.
---------------------------------------
http://www.php.net/manual/function.fopen.php
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+