Filenames with colons
Created by: dasisdormax
As the colon separates the scheme and the reference (filename), things may behave weird or unexpected when working with files that include it in their filename.
While (i guess) not many programs need to work with filenames with colons, they should be able to work without having to write different code for Redox/non-Redox operating systems.
Examples
Example 1:
- Boot into Redox, open a shell as user and execute
touch file:/home/user/:
ls
- ls will fail (trying to get information about the root of the unnamed scheme) outputting just:
error: permission denied
Example 2:
- Boot into Redox, open a shell as user and execute
touch file:/home/user/file:
ls -l
- ls will output the file information about the root directory of the file scheme instead of the file "file:" within the current working directory:
-rw------- 1000 1000 [...] LICENSE
-rw------- 1000 1000 [...] README.md
drwxr-xr-x 0 0 [...] file:
Build information (for both examples): self-built redox rustc 1.17.0-nightly (3da40237e 2017-03-24) git revision 24f080b4 (March 25)
What can we do?
Currently working:
For relative filenames, you can prepend the current working directory to everything. If you use ls $PWD
in the examples above, everything works as expected as $PWD already contains the scheme.
Suggestion, not working today: For paths including slashes (such as the absolute "/home/user/:" or the relative "./:"), it is clear (at least to me) that the program wants to access that file, not a scheme called "/home/user/" or "./". These variants would mean the same on both Redox and non-Redox operating systems.
This does assume though that scheme names can not contain slashes. If it is intended to support such scheme names, this would obviously not be possible.