Req #42741 [Opn->Wfx]: ftruncate extended version

From: Date: Tue, 12 Oct 2021 16:48:32 +0000
Subject: Req #42741 [Opn->Wfx]: ftruncate extended version
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237167@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=42741&edit=1 ID: 42741 Updated by: cmb@php.net Reported by: beotiger at mail dot ru Summary: ftruncate extended version -Status: Open +Status: Wont fix Type: Feature/Change Request Package: Filesystem function related Operating System: * PHP Version: 5.2.4 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This would be grossly unefficient, what is the reason why there is no such variant of ftuncate() in POSIX. If you need that, you can implement it in PHP, and I'd presume that it'd be about as fast as a C implementation. Previous Comments: ------------------------------------------------------------------------ [2007-09-23 15:26:09] beotiger at mail dot ru There should be an extending version of ftruncate which allows you to truncate not the end of file but the beginning of it (to a certain size) - so if you request filesize more than the current size, the zeros would be added at the beginning of file, not to the end (on demand, of course). It'd be useful for any logs, if their size shouldn't be more than the given number. ------------------------------------------------------------------------ [2007-09-23 15:21:42] beotiger at mail dot ru Description: ------------ There should be an extending version of ftruncate which allows you to truncate not the end of file but the beginning of it (to a certain size) - so if you request filesize more than the current size, the zeros would be added at the beginning of file, not to the end (on demand, of course). ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=42741&edit=1

« previous php.bugs (#237167) next »