Bug 7040 - truncate: extend interface (-r & more -s values)
Summary: truncate: extend interface (-r & more -s values)
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.22.x
Hardware: PC Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-18 01:14 UTC by eadmaster
Modified: 2016-02-18 13:36 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eadmaster 2014-04-18 01:14:41 UTC
truncate can do inplace trimming and has a better syntax than dd.

An old implementation is here:
http://svn0.us-west.freebsd.org/base/head/usr.bin/truncate/truncate.c

It is based on the POSIX function "ftruncate"
http://pubs.opengroup.org/onlinepubs/009695399/functions/ftruncate.html
Comment 1 Mike Frysinger 2016-02-18 06:55:11 UTC
GNU coreutils provides truncate and has for a while now.  its interface:
http://www.gnu.org/software/coreutils/truncate
Comment 2 eadmaster 2016-02-18 10:22:15 UTC
the applet was added since v1.24.0, but the current implementation is missing the "-r RFILE" switch and does not support size prefixes like "-20" (= reduce by 20 bytes) that are quite useful imo (you can still workaround that using command substitutions btw).