Funny filenames: so far, no good... (2.9BSD)

jeffrey w percival jwp at uwmacc.UUCP
Wed May 29 12:09:32 AEST 1985


I've had a number of responses on how to remove the file whose name is
	\t 360 200 035 002 \0
but no one has won yet.  Most people recommended using unlink(2) like this:

	main()
	{
		unlink("\t\360\200\035\002");
	}

but this fails.  One person even sent me a program that opened the directory,
searched for the entry representing the bad file, and passed that string,
unmolested in any way, to unlink:

	fd = open(".", O_RDONLY);
	... seek to proper entry ...
	read(fd, &direct, sizeof(direct));
	status = unlink(direct.d_name);

That failed too.  Holy filename, Batman!  What next?

-- 
	Jeff Percival ...!uwvax!uwmacc!jwp



More information about the Comp.unix mailing list