X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: David Kastrup Subject: Re: Problem with stat Date: Tue, 26 Jun 2007 17:34:21 +0200 Lines: 38 Message-ID: <86ps3irapu.fsf@lola.quinscape.zz> References: <46808EA8 DOT 2030202 AT pacific DOT net DOT sg> <4680DD73 DOT 8090300 AT sh DOT cvut DOT cz> <4680E3A0 DOT 3020508 AT pacific DOT net DOT sg> <4680FE40 DOT 7010102 AT byu DOT net> <46810D24 DOT 9000303 AT pacific DOT net DOT sg> <46810FAA DOT 5050508 AT byu DOT net> <86zm2mdfox DOT fsf AT lola DOT quinscape DOT zz> <468112F2 DOT 10802 AT byu DOT net> <86vedade9q DOT fsf AT lola DOT quinscape DOT zz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.51 (gnu/linux) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Eric Blake writes: > David Kastrup gnu.org> writes: > >> >> fstat, yes. But shouldn't stat be able to report S_ISLNK on a broken >> >> link? >> > >> > No. It must fail with ENOENT. >> > http://www.opengroup.org/onlinepubs/009695399/functions/stat.html >> >> No information there. "component of a path" has nothing to do with >> symlink resolution. >> > > "If the named file is a symbolic link, the stat() function shall > continue pathname resolution using the contents of the symbolic > link, and shall return information pertaining to the resulting file > if the file exists." This says nothing about what is returned if the file does not exist. > In other words, if file is a broken symlink, symlink resolution MUST > take place, Nothing whatsoever in the above states this. Only the behavior when the resulting file exists is specified. > at which point, the brokenness of the symlink means that stat() MUST > fail with ENOENT because a component of the path does not exist. I don't see where this is apparent from the wording. > Cygwin is correct here, as is Linux. They don't conflict, but that is all. -- David Kastrup -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/