|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12321 ftruncate poorly named, suggest alias
Submitted: 2001-07-23 13:22 UTC Modified: 2010-12-31 22:48 UTC
From: dshadow at zort dot net Assigned:
Status: Wont fix Package: Filesystem function related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2001-07-23 13:22 UTC] dshadow at zort dot net
The ftruncate function is poorly named, as it can be used to enlarge a file, not just truncate it. I suggest creating an alias to this function, "fresize", to make it clear that a file can be arbitrarially resized. I also suggest that the manual be updated to indicate that ftruncate can enlarge a file as well: "Changes a file's size", rather than, "truncates a file to a given length.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-23 13:51 UTC]
it's just the name of the C function/system call
 doing the same job
 [2001-07-23 13:56 UTC] dshadow at zort dot net
Yes, it is, but that doesn't mean that it's a good name. I'm not suggesting renaming ftruncate. All I want is an alias like fresize so that when looking at the function list, it's easier to find this function, and the documentation updated so that it's clear that ftruncate can make a file larger. Try doing a search for "resize file" or "change file size" on the website. You won't find anything useful.
 [2010-12-31 22:48 UTC]
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-12-31 22:48 UTC]
It's fine as it is.
 [2010-12-31 22:48 UTC]
-Package: *General Issues +Package: Filesystem function related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 01:01:29 2024 UTC