Weird Problem with cat

Wonderly gregg at ihlpb.ATT.COM
Tue Dec 6 09:31:14 AEST 1988


>>How can we get programmers to do this right?
> From the security point of view, it is right.
> 
> Having said all that, I agree that messages like "Permission Denied" are
> a severe pain when one is trying to debug a system.  I tend towards the
> view that you always provide additional information - just not necesssarily
> in a form useful to the end user (like giving the source file/line and
> internal error numbers when an error occurs) when the end-user is just
> a user.

The biggest problem is getting people to use the OS error messages and
capabilities instead of inventing their own.  Time after time I have
changed.

	if ((fd = creat (file, 0600)) == -1) {
		printf ("Can't create some file\n");
		handle_the_error_exit();
	}

to

	if ((fd = creat (file, 0600)) == -1) {
		perror (file);
		handle_the_error_exit();
	}

in code I have ported from the net.  Perror(3) (and the associated
sys_errlist array) is one of the MOST useful parts of the C-library
under UN*X (please don't start another 'errno should not be global'
war though).

-- 
It isn't the DREAM that NASA's missing...  DOMAIN: gregg at ihlpb.att.com
It's a direction!                          UUCP:   att!ihlpb!gregg



More information about the Comp.unix.wizards mailing list