Re: id3 - problems with php_stream_truncate_set_size()
| From: | Sara Golemon | Date: | Fri, 18 Jun 2004 18:40:44 +0000 |
| Subject: | Re: id3 - problems with php_stream_truncate_set_size() | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-863@lists.php.net to get a copy of this message | ||
> I tried ftruncate() now and it seems to work very good. Thanks!
>
Is this only supposed to work on local files? Or should it support remote
files?
My gut reaction would be to use an ifdef to determine what PHPAPI version
you're at. If it's a late enough version to support
php_stream_truncate_set_size, use that. Otherwise use ftruncate directly
and add a note saying that non-localfile wrapper support is limited in PHP4.
You'll of course want to code in the proper checks to keep non-local files
from being used in the older version as well.
-Sara