Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Jul 2000 15:24:09 +0200
From:      Sheldon Hearn <sheldonh@uunet.co.za>
To:        James Howard <howardjp@glue.umd.edu>
Cc:        arch@FreeBSD.ORG
Subject:   Re: truncate(1) implementation details 
Message-ID:  <30275.962630649@axl.ops.uunet.co.za>
In-Reply-To: Your message of "Mon, 03 Jul 2000 09:10:35 -0400." <Pine.GSO.4.21.0007030906530.3963-100000@y.glue.umd.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 03 Jul 2000 09:10:35 -0400, James Howard wrote:

> What does this mean?
> 
> 	howardjp@byzantine:~$ ls -l /etc/profile 
> 	-rw-r--r--  1 root  wheel  963 Sep  6  1999 /etc/profile
> 	howardjp@byzantine:~$ truncate -1024 /etc/profile

Good point, this is a problem, but it has nothing to do with -c.  Do you
agree that truncation that would reduce the number of bytes allocated to
a file below zero should silently set the file size to zero?

> Also, what happens when it is run on a symbolic link or a directory?

Allow truncate(2)'s semantics to "shine through", following symbolic
links.

> A block or character device?

Block dewhat? :-)

I would have expected truncate(2) to fail with ENOTSUPP on devices, but
that's not what the manual page says.

Ciao,
Sheldon.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?30275.962630649>