After the following change, I could look at the
original 8.3 file name data that made fsck.vfat
think the file name entry was incorrect.
Of the four filenames reported, all the four 8.3 names seem to contain
backslash which was considered incorrect. (I say "seem to" because
one of the filenames contain a control character or something and
looking at it caused some garbled character. I am not sure how such
character passes through the sanitization done by file_name(). The
control character seems to be octal \352?
OK, here is the transcribed 8.3 name for the second invalid filename above.
<<\210\352\227\227\225\~1.LNK>>
The octal 0352 seems to be printed as is, and so causes some confusion.
You can ses that a literal "\" is at the 6th byte. This I believe
is the part of a single two byte character code 0225 followed by ascii
value of '\'. This character is the last character of the three kanji
character word "Ichi-ran-hyou", which means roughly "Table of All
Items". "\225\" is the kanji for "table".
In any case, unfortunately, Japanese character (two bytes for one
Kanji/Kana character) filenames CAN contain such binary code (ASCII value '\')
for the second position of the two bytes char code.
That is, there are Kanji character codes that has the binary value
of ASCII code of '\' in the second byte position.
fsck.vfat (a ka dosfsck) looks at this value and thinks the
file entry is bogus, and suggests renaming.
--- 579,585 ----
if (!((*walk)->dir_ent.attr & ATTR_VOLUME) &&
bad_name((*walk)->dir_ent.name)) {
printf("%s\n Bad file name.\n",path_name(*walk));
+ printf("<<%s>> 8.3 form\n", file_name((*walk)->dir_ent.name));
if (interactive)
printf("1) Drop file\n2) Rename file\n3) Auto-rename\n"
"4) Keep it\n");
Suggested/Possible FIX:
Find out the character code system used for the filename entry in the
disik file system if available.
(I have no idea if such global data exists in FAT/VFAT system.
IIRC, OS/2 HPFS seemed to have it.
NTFS probably has it or use unicode for all.)
dosfsck can use that information to make the checking of "invalid"
charcter in bad_name() routine more intelligent.
If such character code system information is not on the hard disk,
then prompt the user for it (or at least prints out the assumed
character code system) Use the given (or default) character code
syste for checking "invalid" character in the 8.3 file name.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]