|
From: | Ken Brown |
Subject: | bug#32246: 27.0.50; files-tests failure on Cygwin |
Date: | Thu, 26 Jul 2018 10:54:38 -0400 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 7/26/2018 9:56 AM, Michael Albinus wrote:
Michael Albinus <michael.albinus@gmx.de> writes:
Hi Michael,
It looks that on cygwin, file-name-case-insensitive-p returns different values for existing and non-existing files: --8<---------------cut here---------------start------------->8--- M-! touch /tmp/foo (file-name-case-insensitive-p "/tmp/foo") => nil (file-name-case-insensitive-p "/tmp/bar") => t --8<---------------cut here---------------end--------------->8---
Right. If the file doesn't exist, then the call to pathconf fails with ENOENT, as required by POSIX (http://pubs.opengroup.org/onlinepubs/009695299/functions/fpathconf.html). The fallback code in file_name_case_insensitive_p then kicks in and returns true on Cygwin.
The doc of file-name-case-insensitive-p does not require that FILENAME exists.
I think the doc is ambiguous on that. The first sentence of the doc in the elisp manual says, "Sometimes file names or their parts need to be compared as strings, in which case it’s important to know whether the underlying filesystem is case-insensitive." This certainly suggests that the file should exist, but there's no indication of what the function returns for a non-existent file. And the code doesn't attempt to detect this case.
I don't know what the right solution is. Thanks for tracking down the problem. Best regards, Ken
[Prev in Thread] | Current Thread | [Next in Thread] |