delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/01/29/14:35:12

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=So8g4d58IkOxjbKy
6wzkbWtyJRR+Oseu8zVtovpiUbvrVd4X9Ld7ZdjUtPLIQx4RyvuynYX+YmDWFIRM
g9FP/7ODokXBU3Q0ZPvfhFxWgxfAfQ8sIW7jVBdxYCY4+eSGHSTRAJ1gxab9xiRN
7XabgSILf/a83P+lZ2A8hlnChWc=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=+IP7pDjADzZzytC8I+vlWO
mVwsk=; b=a2CNT+B+C6H8M2jw8a4f1ms4pfKM3GjSzsmARPsa2wFLgf+oHLSRr9
1oc/47eT8P6T/hAxIIIiw8tesgSCMznLS4/3UK3hMxzedh580cSu4Fsybi+AkX7/
yOGugTjsM5SJjjcQa57ZVSwqZrHMTl/T7/r6IZekAniibev23GZek=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=29012017, 29.01.2017, H*i:sk:34cdfec, H*f:sk:34cdfec
X-HELO: mout.kundenserver.de
Subject: Re: dirent.d_type is not working on Cygwin symbolic links.
To: cygwin AT cygwin DOT com
References: <b431ce093f2949901c68c3c93fe0693c AT xs4all DOT nl> <639803f1-432c-005d-98c2-db982618c0e2 AT t-online DOT de> <34cdfeceeb1885c645ff52b2c244cab5 AT xs4all DOT nl>
From: Thomas Wolff <towo AT towo DOT net>
Message-ID: <7eda901b-2a0e-f04a-5b37-00e6df852465@towo.net>
Date: Sun, 29 Jan 2017 20:34:32 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
MIME-Version: 1.0
In-Reply-To: <34cdfeceeb1885c645ff52b2c244cab5@xs4all.nl>
X-UI-Out-Filterresults: notjunk:1;V01:K0:Ye2lW8FVHgA=:Wr11WtmQihBHUPxbrrkJ6l gkZMlq3iI5lnYdbxmE9xJ3L+xZo0pCO4Jgfd29y4v/FI9b5K+XWxOLlRPSuPuBA6UGVKrtpMz OYEE1Khhomb6fX3v5T7lwv5ngA4om8Zbr536GIrwg/Rr7DsNYA5+K34rhCUHMAqPn07kOISbL 3zvGbwZE2YSOgc3pLCO/cMNWSdm+B1l8DuTZ3EN31W3/SnlYIhRanNMiTtGyJfXrHBdGk88TO eMfaFh6WrXjpso+CFdze+omVA827nffgRp9bB8av4LvQYC3sM9Dsvwfk59b/ZOsM3GV61hF2T PgDaXSe7k6KeGtU1MuCGaTyVAhv7fJrSMtW9niNaCfZJ7vounvX9eIFs9V3hxoGJzg07C3kdg 9yXLzvozBMKaLo/jgnwLs3hQmCFd+G+quFEcxtHzMAzR7710sjwJBkVvD1J6ALGxcLiH1Swrp 5SvAcRWInmf2Z47j9v2/Ro3XYCiLgDSAGbe+k8RkJFsdxX1y28eCkKwSzweab78dNm1jhpO4M q+BtVQej7ugEj/3LxaEbcvLumzHFXPr0oqcLGd38MuXKq0bSlBcwQ0LUovQLI0RAOVrY+pGft fvrzCGbzAlAs5iegDAj8uIuG/SoPhlQ4L+7jhFPXruUah/hGx3HsUlSLN8y0q0y9JFBIF6szO ZAdI00EYCDKEO5u58qJ/wQeMNR07IrlUu8+b9vLxGedxZ4QuThyR0hzj975usA+usuPpEAc8z th7P5PortoehoNaO
X-IsSubscribed: yes

Am 29.01.2017 um 20:17 schrieb waterlan:
> Christian Franke schreef op 2017-01-29 12:15:
>> waterlan wrote:
>>> The dirent.d_type value for Cygwin symbolic links is 0 (DT_UNKNOWN). 
>>> The value is 10 (DT_LNK) for Windows native symbolic links. I think 
>>> d_type should be 10 for Cygwin symbolic links too.
>>>
>>
>> Sorry, no.
>>
>> The actual type should only be returned in dirent.d_type if the info
>> is available at very low cost. This is not the case for Cygwin
>> symbolic links.
>>
>> If DT_UNKNOWN is returned, lstat() must be called if type info is 
>> required.
>>
>> Quote from Linux man page readdir(3):
>> "All applications must properly handle a return of DT_UNKNOWN."
>> (https://linux.die.net/man/3/readdir)
>>
>> See also thread starting at:
>> https://sourceware.org/ml/cygwin-patches/2008-q4/msg00000.html
>
> In this case I do not agree with this. Cygwin symbolic links are there 
> to emulate Linux symlinks. Therefore I expect the same behaviour.
>
> ``Cygwin is
> * a large collection of GNU and Open Source tools which provide 
> functionality similar to a Linux distribution on Windows.''
> (https://cygwin.com/)
As you're quoting from the cygwin home page, you chose the wrong bullet. 
It's about tools while the functionality you are commenting about is 
provided by
> * a DLL (cygwin1.dll) which provides substantial POSIX API functionality.
So the reference here is POSIX, not Linux, if we're getting picky. And 
as Christian Franke had already quoted, the field in question is not 
mandatory at all by POSIX. So you'll have to do what other people also 
do: defensive programming, not expecting too much but taking all cases 
into account.
------
Thomas

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019