Date: Mon, 03 Jul 2000 10:35:05 +0200 From: Sheldon Hearn <sheldonh@uunet.co.za> To: arch@FreeBSD.org Subject: truncate(1) implementation details Message-ID: <904.962613305@axl.ops.uunet.co.za>
next in thread | raw e-mail | index | archive | help
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 <alex@big.endian.de> To: Sheldon Hearn <sheldonh@uunet.co.za> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?904.962613305>