php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dshadow at zort dot net
New email:
PHP Version: OS:

 

 [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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-23 13:51 UTC] hholzgra@php.net
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] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-12-31 22:48 UTC] jani@php.net
It's fine as it is.
 [2010-12-31 22:48 UTC] jani@php.net
-Package: *General Issues +Package: Filesystem function related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC