Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The short file name is automatically and compulsorily constructed from the LFN using the algorithm you mentioned. (Also detailed in the FAT32 <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/gg463080.aspx" rel="nofollow">specifications</a>). This is done by the file-system driver (at least on Windows and Linux).You really can't change that, unless you modify the driver which is not advisable. If you want to do this only for one directory, then you could achieve this by modifying the disk image in a hex editor being wary of not creating duplicate entries with the same name.</p> <p>Here is what I tried on Linux:</p> <pre><code>#dd if=/dev/zero of=fatImage bs=1048576 count=256 #mkfs.vfat -F 32 fatImage #mount -o loop fatImage /mnt #cd /mnt #mkdir ThisIsALongDirectoryName </code></pre> <p>The fat driver generates a short name for the directory:<strong>THISIS~1</strong>. You can use both names to access it.</p> <pre><code>#cd /mnt/ThisIsALongDirectoryName #cd /mnt/THISIS~1 </code></pre> <p>Then after unmounting the partition, I opened the image in a hex editor(Okteta on KDE), searched for the SFN entry <strong>THISIS~1</strong>, and replaced it with <strong>MYNEWDIR</strong>. Also,each 32 byte LFN sub-entry stores a checksum of the SFN at offset 13. So I had to <a href="https://gist.github.com/4440535" rel="nofollow">calculate</a> and replace the checksum of THISIS~1(which is 0xA6) with the checksum for MYNEWDIR(which is 0x6A) in all the LFN sub-entries.After saving the modifications,I remounted the image and was able to access the directory using the old LFN and the new SFN.</p> <pre><code>#cd /mnt/ThisIsALongDirectoryName #cd /mnt/MYNEWDIR </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload