Ticket #313 (Fixed)Tue Sep 04 08:04:23 UTC 2012
DOSFS doesn't follow Microsoft guidelines for creating the short name
Reported by: | Sprow (202) | Severity: | Normal |
Part: | RISC OS: Module | Release: | |
Milestone: | Status | Fixed |
Details by Sprow (202):
Example
*RENAME was_a_long_filename/txt muchless/txt
results in “MUCHLE~1.TXT” being created as the shortened version (when viewed with dir /x in Windows). In this instance the shortened name can be represented by merely uppercasing.
Someone needs to review the MS long filenames spec (free download!), it seems DOSFS was modified without bothering to do this.
Changelog:
Modified by Chris Hall (132) Tue, July 23 2013 - 07:43:26 GMT
Note that *COPY was_a_long_filename/txt muchless/txt behaves differently under RISC OS depending whether the file ‘muchless/txt’ already existed. If it did, then the capitalisation is preserved regardless of what the COPY filename is (e.g. MuChLeSs/TxT and muchless/txt would be treated the same). This might need to be fixed also?
Modified by Rick Murray (539) Wed, November 13 2013 - 18:55:34 GMT
The interesting thing here is that doing this operation under Windows (XP) preserves the case of the file (lowercase) and considers this to be the file’s short name. How does this work?
I bet Textile will screw this up…
<pre>E:\rename_test>dir /x
Directory of E:\rename_test
10/11/2013 21:40 9,643,768 WAS_A_~1.AVI was_a_long_filename.avi
1 File(s) 9,643,768 bytes
2 Dir(s) 9,756,672 bytes free
E:\rename_test>rename was_a_long_filename.avi muchless.avi
E:\rename_test>dir /x
Directory of E:\rename_test
10/11/2013 21:40 9,643,768 muchless.avi
1 File(s) 9,643,768 bytes
2 Dir(s) 9,756,672 bytes free
E:\rename_test></pre>
[drive ID snipped to save space]
The Microsoft spec says “<i>If the name is longer than 8.3, or contains lower case characters, then a long name entry must be created for the file and an 8.3 name will automatically be generated from it and stored in the 8.3 entry.</i>”, however DIR /X shows no such short name entry.
However, if we were to rename the file to have a mixed case filename:
<pre>E:\rename_test>rename muchless.avi SomeFile.avi
E:\rename_test>dir /x
Directory of E:\rename_test10/11/2013 21:40 9,643,768 SOMEFILE.AVI SomeFile.avi
1 File(s) 9,643,768 bytes
2 Dir(s) 9,756,672 bytes free
E:\rename_test></pre>
You can see that both a short name and a long name exist for this file, and both are identical in the eyes of the OS (it is case insensitive, there’s no blah~1 variation here).
So why does there appear to be no such behaviour for a file specified using a purely lower case filename?
Modified by Sprow (202) Wed, June 25 2014 - 19:39:23 GMT
- Status changed from Open to Fixed
Re: the apparent lowercasification in WinXP, I think that’s just that Explorer recases names it finds in all uppercase, the on disc copy is sensible.
Fixed in DOSFS-1_06.