How to manage short file name?

Hi guys,

I’m developing a filter file system that execute on windows and I don’t know yet how treat short file names. Is there any well defined way to do it? Is there a public algorithm to generate a short file name for each file?

Thanks,
Giovanni

Why do you think you need to worry about this? What is your filter
doing that needs to worry about the short name / long name question?
This is typically the domain of file systems proper not drivers that
filter them.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“xxxxx@lsd.ufcg.edu.br” wrote in message
news:xxxxx@ntfsd:

> Hi guys,
>
> I’m developing a filter file system that execute on windows and I don’t know yet how treat short file names. Is there any well defined way to do it? Is there a public algorithm to generate a short file name for each file?
>
> Thanks,
> Giovanni

Well, there is one routine, RtlGenerate8dot3Name (http://msdn.microsoft.com/en-us/library/windows/hardware/ff552285(v=vs.85).aspx). However, the problem is that unless you generate all the short names in a directory there is no good way to prevent collision (if the file system generates some short names for some files in a directory and you generate them for some other files (presumably your files will be virtual files) then there is no synchronization to guarantee that both you and the FS won’t generate the same name for different files…).

However you might be better off not generating any short names (they’re a sort of legacy thing anyway and I personally wish that MS will pull the plug on them).

Thanks,
Alex.

We are slowly easing the plug out of the socket, as it were. In Windows 8 short names can be supported on a per-volume basis. By default they’re enabled only on the SYSTEM volume. On non-SYSTEM volumes (by default) not only are they not auto-generated, they’re not even createable.

Unless you are supporting applications that are nearly 20 years old, why bother with short names?

Christian [MSFT]
This posting is provided “AS IS” with no warranties, and confers no rights.

In fact, we’re developing a distributed file system that must execute on windows clients and we want to support all kind of files. So we think that if one of these clients needs to use short file name, our file system should support it. But we’re still discussing about it.

I really thank you all for the help,
Giovanni
MSc in Computer Science
Member of BeeFS Project: www.lsd.ufcg.edu.br/beefs

Well, if you’re developing the whole FS then RtlGenerate8dot3Name should be good enough. Though again you might not need to support this feature. Since your file system isn’t a system volume (just guessing) and because in Win8 MS doesn’t allow short names on non-system volumes then i’d say you have a pretty strong case for not supporting short names…

Thanks,
Alex.

Just to be clear, the short name support is configurable via the fsutil tool. Out of the box Windows 8 doesn’t support short names on non-SYSTEM NTFS volumes, but that is configurable by the end user.

Note that newer file systems from Microsoft don’t have short name support. exFAT is one that has already been released, and ReFS (new to Windows 8) also doesn’t support them.

Christian [MSFT]
This posting is provided “AS IS” with no warranties, and confers no rights.

> We are slowly easing the plug out of the socket, as it were. In Windows 8 short names can be

supported on a per-volume basis.

Also ReFS will not support short names.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com