file-system-access icon indicating copy to clipboard operation
file-system-access copied to clipboard

Handling file case

Open monster860 opened this issue 5 years ago • 3 comments

Currently the spec has no mention of uppercase/lowercase distinctions for files at all. Currently, if you use getFile() on the latest Chrome, it returns a file handle with the specific case that is provided - for example if you enter FILE.TXT, it will return a handle with the name of FILE.TXT even if the file is actually called file.txt. This means the only way to actually verify the actual case of the filename, you must iterate over the parent directory to find the case. Another thing I'd like to know is how this would be handled on systems where filenames are case sensitive, such as linux. Does it reject on files with the wrong case?

monster860 avatar Jan 30 '20 07:01 monster860

It definitely would (and imho should) reject on case sensitive file systems if you use the wrong case.

I'm less sure what the behavior should be on case insensitive (but case preserving) file systems. Could you elaborate more on the use cases where you need to know what the casing is of the existing file?

mkruisselbrink avatar Apr 09 '20 18:04 mkruisselbrink

Can this be closed? was it implemented?

ftreesmilo avatar Jul 18 '21 19:07 ftreesmilo

We should clarify the current behavior in the spec, as it's currently largely silent on file case. There is also overlap with w3c/FileAPI#161, as that ultimately is about how OS level file names map to the name attribute of returned File objects.

mkruisselbrink avatar Jul 20 '21 20:07 mkruisselbrink