Subject: RE: Suggestion: inclusion of the truncate(1) utility into the tree
To: Trever Miller <Trever.Miller@veritas.com>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 07/21/2000 21:33:09
[ On Friday, July 21, 2000 at 15:42:00 (-0700), Trever Miller wrote: ]
> Subject: RE: Suggestion: inclusion of the truncate(1) utility into the tre 	e 
>
> FWIW, this truncate(1) util looks so trivial that it could be
> done in a few lines of bourne shell script.  If anyone really
> needs such a util for their scripts, to embed in their scripts
> and thus make them portable... I could hammer out the
> equivalent pdq, for their edification.

Sorry but no, you cannot.  It is not possible to do from the shell, awk,
dd, cat, or whatever, what truncate(2) and ftruncate(2) do, at least not
without building a truncate() call into the tool of your choice.  You
can simulate it in some respects, but the real thing is special and can
only be done by a system call.  Because of this I've twice now written a
very similar C program for my own use in shell scripts! ;-)

So yes, I do vote in favour of including the truncate utility, and
purely for utilitarian purposes, not necessarily because I want
portability.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>