From owner-freebsd-arch Mon Jul 3 1:35:14 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 229B737B80A for ; Mon, 3 Jul 2000 01:35:08 -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 1391h3-0000Eb-00 for arch@FreeBSD.org; Mon, 03 Jul 2000 10:35:05 +0200 From: Sheldon Hearn To: arch@FreeBSD.org Subject: truncate(1) implementation details Date: Mon, 03 Jul 2000 10:35:05 +0200 Message-ID: <904.962613305@axl.ops.uunet.co.za> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi folks, I'm looking through Alexander Langer's truncate(1) with a view to importing it shortly. I raised some issues with Alexander and he responded with the message below. The issue I'd like feedback on is whether or not truncate(1) should create files given on the command-line when those files do not exist at the time of invocation. My feeling is that truncate should not do so. Alexander's opinion is given in the e-mail message. Any compelling arguments in either direction? Ciao, Sheldon. ------- Forwarded Message Date: Sun, 2 Jul 2000 19:36:44 +0200 From: Alexander Langer To: Sheldon Hearn Subject: Re: cvs commit: truncate - Imported sources Message-ID: <20000702193644.A11353@cichlids.cichlids.com> Thus spake Sheldon Hearn (sheldonh@uunet.co.za): > Drop the -h option. Look at cat and friends for examples. > Simple utilities don't need this. yes > Drop the special case for '?', which is caught by the default > case anyway. yes > Implement usage() properly, as per style(9). aaaah, style(9)! I knew I've read about the proper usage() function style before, but I couldn't remember, where :-)) > Use EXIT_SUCCESS and EXIT_FAILURE for exit() and EX_* for > errx(). yes :) > Also, are you _sure_ the file should be created if it didn't already > exist? I think this is a bad idea. This is a userland interface into > truncate(2), which does _not_ create non-existant files. not sure. It saves a call to touch(1). Hmm. What about -c: Create file if it doesn't exit? (or don't create, depends on the chosen default value). However, please ask -committers or -hackers about that. I'll leave tomorrow. Alex - -- cat: /home/alex/.sig: No such file or directory ------- End of Forwarded Message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message