getting the on-disk case for a path
Glenn Strauss
gs-cygwin.com@gluelogic.com
Fri Aug 8 06:06:20 GMT 2025
On Thu, Aug 07, 2025 at 05:31:11PM -0700, Jeremy Drake via Cygwin wrote:
> On a case-insensitive but case-preserving filesystem, is there a Cygwin
> API to get the on-disk case for a given path? It seems like `realpath`
> ought to do it but running
> $ touch case-test
> $ realpath CASE-TEST
> returns CASE-TEST. Regardless, canonicalize_file_name or realpath may not
> be what I want because it would dereference symlinks.
>
> Background: I'm trying to debug some test failures in Clang, due to a
> warning that's supposed to be issued when you #include "foo.h" but the
> file on disk that it opened is "Foo.h".
Not directly answering your initial question, but I have found the -H
compiler flag useful for troubleshooting from where files are included:
If you change the compiler command line from gcc/clang "... -o foo.o"
to "-H", then the compiler outputs a list of header files paths as they
are included by the preprocessor.
Cheers, Glenn
More information about the Cygwin
mailing list