Bug 7040

Summary: truncate: extend interface (-r & more -s values)
Product: Busybox Reporter: eadmaster <mantoxpub>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: enhancement CC: busybox-cvs, mantoxpub
Priority: P5    
Version: 1.22.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

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