f.el icon indicating copy to clipboard operation
f.el copied to clipboard

Doesn't handle case preserving, case insensitive operating systems

Open raxod502 opened this issue 8 years ago • 3 comments

On macOS, /path/to/dir is equivalent to /path/TO/dir because the filesystem is case insensitive but case preserving. However, the following function call returns nil instead of t:

(f-ancestor-of? "/path/to" "/path/TO/dir")

raxod502 avatar Sep 27 '17 22:09 raxod502

Handling such filesystems is generally hard or impossible on a library level. For example, there's no way to figure out whether /path/to and /path/TO will refer to the same directory without creating that directory. Maybe the docstring should just document that the comparison is purely lexical (except for converting the filenames to absolute names) and case-sensitive?

phst avatar Dec 22 '17 21:12 phst

I think one way to handle such filesystems would be to have a variable that the user could set if they are on such a filesystem.

Leaving the problem to the user would also be reasonable, though.

raxod502 avatar Dec 23 '17 01:12 raxod502

This might be relevant:

* Lisp Changes in Emacs 26.1
[...]
** The new function 'file-name-case-insensitive-p' tests whether a
given file is on a case-insensitive filesystem.

npostavs avatar May 20 '18 13:05 npostavs