Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!samsung!cs.utexas.edu!execu!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F. Haugh II) Newsgroups: comp.unix.wizards Subject: Re: of course! Summary: No, not really ... Message-ID: <17303@rpp386.cactus.org> Date: 14 Nov 89 13:26:10 GMT References: <152@norsat.UUCP> <2586@unisoft.UUCP> <15769@bloom-beacon.MIT.EDU> <17264@rpp386.cactus.org> <4526@ski.cs.vu.nl> Reply-To: jfh@rpp386.cactus.org (John F. Haugh II) Organization: Lone Star Cafe and BBS Service Lines: 27 In article <4526@ski.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >In article <17264@rpp386.cactus.org> jfh@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@rpp386.cactus.org | ... EMACS makes a computer slow. UUCPNet: {texbell|bigtex}!rpp386!jfh +--<><--<><--<><--<><--<><--<><--<><---