the file with the empty name "" (was: csh core dumping)

Maarten Litmaath maart at cs.vu.nl
Thu Dec 22 18:46:48 AEST 1988


greim at sbsvax.UUCP (Michael Greim) writes:
\... When you issue an
\open or exec with an empty string, you succeed and get the first file in your
\current directory, which almost certainly is '.', the directory itself.
\Thus csh tries to execute '.', fails and reports the error using errno.
\(You can repeat this by just calling 'execl ("", "abc", 0); perror ("HEY");')

The file `-csh' is a symbolic link to /bin/csh.

	% ls -a | head -3
	-csh
	.
	..
	% cat c.c
	main()
	{
		open("", 1);
		perror("\"\"");
	}
	% cc c.c
	% a.out
	"": Is a directory
	%

"" is always the current working directory.
-- 
if (fcntl(merry, X_MAS, &a))          |Maarten Litmaath @ VU Amsterdam:
        perror("happy new year!");    |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.questions mailing list