Re: [PHP4BETA] File truncation

From: Date: Mon, 28 Feb 2000 14:17:21 +0000
Subject: Re: [PHP4BETA] File truncation
References: 1 2 3  Groups: php.version4 
Request: Send a blank email to php-version4+get-11126@lists.php.net to get a copy of this message
: I wrote a class with a bunch of file functions, ftruncate being one of them, in : PHP, I am going to try to add it to PEAR once I figure out how to add stuff to : the repository and add a few more functions. Cool. But I think it will be MUCH faster if an internal function ftruncate() would call ftruncate() (C function) on a valid file descriptor (handle in PHP). You could also create another function to accept the *file handle* instead of the physical file path for truncation, but this would require you to check if the handle passed is valid descriptor of an open file but I can't find any function which allows you to verify that. I don't know if it would be useful or not, but I don't find ungetc() either! (fgetc() is there!) Faisal P.S. oops, just checked, they call it 'file pointer' and neither 'file descriptor' nor 'file handle'. : : Sterling Hughes : sterling@designmultimedia.com : : (class attached) : : > Because you havent opened up the source and coded it in yet? : > : > Seriously, its probably because no-one has needed it before. : > : > Matt : > : > Faisal Nasim wrote: : > > : > > Hi, : > > : > > Why doesn't PHP support ftruncate()? : > > : > > Thanks. : > > : > > Faisal

« previous php.version4 (#11126) next »