From owner-freebsd-arch Mon Jul 3 6:24:28 2000 Delivered-To: freebsd-arch@freebsd.org Received: from axl.ops.uunet.co.za (axl.ops.uunet.co.za [196.31.2.163]) by hub.freebsd.org (Postfix) with ESMTP id 1114C37C08C for ; Mon, 3 Jul 2000 06:24:22 -0700 (PDT) (envelope-from sheldonh@axl.ops.uunet.co.za) Received: from sheldonh (helo=axl.ops.uunet.co.za) by axl.ops.uunet.co.za with local-esmtp (Exim 3.13 #1) id 1396Cn-0007sK-00; Mon, 03 Jul 2000 15:24:09 +0200 From: Sheldon Hearn To: James Howard Cc: arch@FreeBSD.ORG Subject: Re: truncate(1) implementation details In-reply-to: Your message of "Mon, 03 Jul 2000 09:10:35 -0400." Date: Mon, 03 Jul 2000 15:24:09 +0200 Message-ID: <30275.962630649@axl.ops.uunet.co.za> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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