Subject: Re: Suggestion: inclusion of the truncate(1) utility into the tree
To: Tobias Weingartner <>
From: Alexander Langer <alex@FreeBSD.ORG>
List: tech-userlevel
Date: 07/23/2000 11:35:11
Thus spake Tobias Weingartner (

> > > 4) "truncate file" should mean truncate to zero.
> > No, that's a security risk.
> Care to elaborate?!?  How is this any different than
> cp /dev/null file?  Why would it be a security risk?

Well, I meant because of the following:
truncate(1) will be often used in scripts.

If you do something like
/usr/bin/truncate ${size} ${file} and $size is empty, it will truncate
the file to 0, even if you wanted it to raise it by 100MB or similar.
This won't happen with rm, which also deletes content, since the
syntax for rm doesn't require to args.

Well, on the other hand, it has always been UNIX tradition to let
people shoot into their feet if they want to.


cat: /home/alex/.sig: No such file or directory