Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!csus.edu!beach.csulb.edu!nic.csu.net!csun!kithrup!sef From: sef@kithrup.COM (Sean Eric Fagan) Newsgroups: comp.unix.wizards Subject: Re: POSIX bashing (Was Re: Retaining file permissions) Keywords: chmod, sed, awk... and good old *cat*! Message-ID: <1991Mar08.224707.7330@kithrup.COM> Date: 8 Mar 91 22:47:07 GMT References: <21795@yunexus.YorkU.CA> <3419@unisoft.UUCP> <6499@auspex.auspex.com> Organization: Kithrup Enterprises, Ltd. Lines: 24 In article <6499@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >One can think so only if one ignores the presence of, say, "mkdir()", >"rmdir()", and "rename()", or a BSD-flavored signal mechanism in POSIX. I hereby place, into the public domain, the following POSIX-compliant rename(): #include #include int rename(from, to) char *from, *to; { if (access (from, 0) == -1) return -1; errno = EBUSY; return -1; } -- Sean Eric Fagan | "I made the universe, but please don't blame me for it; sef@kithrup.COM | I had a bellyache at the time." -----------------+ -- The Turtle (Stephen King, _It_) Any opinions expressed are my own, and generally unpopular with others.