of course!

John F. Haugh II jfh at rpp386.cactus.org
Wed Nov 15 00:26:10 AEST 1989


In article <4526 at ski.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:
>In article <17264 at rpp386.cactus.org> jfh at rpp386.cactus.org (John F. Haugh II) writes:
>\We know all of the initial path exists because of the first access()
>\call.
>
>Can you say `race condition'?

Any number of suitably paranoid conditions exist.

>	isadir(char *path)
>	{
>		char dir[PATH_MAX];
>
>		strcpy(dir, path);
>		strcat(dir, "/.");
>
>		return access(dir, 0);
>	}

On the other hand, not all file systems are going to contain `.' and
`..'.  However, all file systems in the UNIX domain do include files
with names like `x' inside of subdirectories ;-)
-- 
John F. Haugh II                        +-Things you didn't want to know:------
VoiceNet: (512) 832-8832   Data: -8835  | The real meaning of EMACS is ...
InterNet: jfh at rpp386.cactus.org         |   ... EMACS makes a computer slow.
UUCPNet:  {texbell|bigtex}!rpp386!jfh   +--<><--<><--<><--<><--<><--<><--<><---



More information about the Comp.unix.wizards mailing list