POSIX bashing (Was Re: Retaining file permissions)

Donn Terry donn at hpfcdc.HP.COM
Tue Mar 12 04:09:59 AEST 1991


>Sean Fagan writes about an implementation of rename():

1) There are similar degenerate cases in any standard you care to name;
   the phases "quality of implementation" and "suitability to purpose"
   come to mind.

2) Where were you for the last Wierdnix contest??

Donn Terry
Speaking only for myself.
--------------------------------
>In article <6499 at auspex.auspex.com> guy at 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 <unistd.h>
>#include <errno.h>

>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 at 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.
>----------



More information about the Comp.unix.wizards mailing list