[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -e test for file exists problem with dangling symlinks

From: Chet Ramey
Subject: Re: -e test for file exists problem with dangling symlinks
Date: Tue, 22 Feb 2005 13:49:39 -0500
User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

John R. Vanderpool wrote:
this will probably be considered a non-bug (because the same behavior
exists in bash, ksh, pdksh, irix, and gnu coreutils!) but i'ld at least
like to hear an explanation if possible.

-e file exists test fails if file is a dangling symlink, this to me does
not seem like the correct behavior, the test should not follow the symlink
(lstat'ed instead of stat'ed).

Unless an operator explicitly acts on the link, it should follow
symlinks.  That is what open(2) does, for instance.

if anything there should be a note in the man page at least.

The current (development) version of the manual page includes:

Unless otherwise specified, primaries that operate on files follow sym-
bolic links and operate on the target of the link, rather than the link

``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Chet Ramey, ITS, CWRU    address@hidden    http://tiswww.tis.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]