Re: ftruncate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/15/07, Richard Lynch <ceo@xxxxxxxxx> wrote:
On Thu, March 15, 2007 4:57 am, Swati Asthana wrote:
> Is there any function in php through which we can delete / truncate
> the
> content of a text file that is before the file pointer/file handler ?
>
> can we use truncate?
> actually im using a function to pick the content from a text file
> using 2
> delimiters, but that function checks only the first instance of the
> delimiter..

If you want to chop the END of a file off, the ever-so-cleverly-named
ftruncate will do that.
http://php.net/ftruncate

If you want to chop the FRONT of a file off, I don't think you can do
that...  In fact, given the way some operating systems maintain their
file catalogs, I'm almost positive you can't do that.
What about reading the rest of the file and store it in a new file?
Then delete old file, and rename new file to old file and you have
what you need i think.

Tijnema

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux