[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::ultrix

Title:Volume 4, Take a RISC with ULTRIX
Notice:Read 1.*!!!! No OSF/1 questions allowed!
Moderator:SSDEVO::ROLLOW
Created:Wed Jun 05 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:5478
Total number of notes:14927

5468.0. "ls a non-existing file does not return non-zero code" by NNTPD::"[email protected]" (Feynman Lo) Mon Apr 14 1997 23:50

A customer have reported that 'ls' a non-existent file does not
return a non-zero code when he tried to use it inside his program.

He is using Ultrix 4.5
He has also done with it in Digital Unix on Alpha platform
but it does return a non-zero code 'correctly'.

Is it a bug or design issue?

- feynman

[Posted by WWW Notes gateway]
T.RTitleUserPersonal
Name
DateLines
5468.1NABETH::alanDr. File System's Home for Wayward Inodes.Tue Apr 15 1997 15:3411
	Probably more a case of wrong application for problem.  ls(1)
	often operates are more than one file at a time.  If you want
	to test for the existance of a file, use test(1).  If you need
	the ls(1) information about that file, use ls(1) after you know
	it exists.

	What would ls(1) return when you use a wildcard and some of
	files exist and some don't?  A failure will be wrong, because
	it succeeded.  A success is wrong because some failed.  There's
	no right answer, so ls(1) probably has the take the path that
	causes the least trouble.