php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42741 ftruncate extended version
Submitted: 2007-09-23 15:21 UTC Modified: 2021-10-12 16:48 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: beotiger at mail dot ru Assigned: cmb (profile)
Status: Wont fix Package: Filesystem function related
PHP Version: 5.2.4 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: beotiger at mail dot ru
New email:
PHP Version: OS:

 

 [2007-09-23 15:21 UTC] 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).



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-23 15:26 UTC] 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.
 [2011-04-08 21:14 UTC] jani@php.net
-Package: Feature/Change Request +Package: Filesystem function related -Operating System: any +Operating System: *
 [2021-10-12 16:48 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-10-12 16:48 UTC] cmb@php.net
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.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jun 03 03:03:40 2023 UTC