Hi all,
A few short filename/long filename questions…
* I saw somewhere in the archives someone saying that ALL SFNs have a
tilde character in them. Is this true?
* If a file is created with a name that would qualify as an SFN and an
LFN, is it assigned to both LFN and SFN by the FSD, if it is a FSD that
supports both, the different being one is case sensitive?
* Do FSDs always have something assigned to the SFN and the LFN? If
not, what is the form of the FILE_BOTH_DIR_INFORMATION name fields on an
IRP_MJ_DIRECTORY_CONTROL/IRP_MN_QUERY_DIRECTORY when one doesn’t exist?
Thanks,
Matt
> * I saw somewhere in the archives someone saying
that ALL SFNs have a
tilde character in them. Is this true?
No. New backup apis in XP allow the short name to be
set to whatever. Also, I believe it was pointed out
recently that NTFS will start generating short names
without tildes after a certain (large) number of name
conflicts.
* If a file is created with a name that would
qualify as an SFN and an
LFN, is it assigned to both LFN and SFN by the FSD,
if it is a FSD that
supports both, the different being one is case
sensitive?
NTFS and FAT preserve case but don’t pay any attention
to it. I seem to recall that there is some switch for
NTFS that will make it work case sensitive.
* Do FSDs always have something assigned to the SFN
and the LFN? If
not, what is the form of the
FILE_BOTH_DIR_INFORMATION name fields on an
IRP_MJ_DIRECTORY_CONTROL/IRP_MN_QUERY_DIRECTORY when
one doesn’t exist?
I don’t have my code in front of me, but I believe
that if the short name field is empty then the long
name is the same as the short name. It might be the
other way around.
Randy
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
> > * I saw somewhere in the archives someone saying
> that ALL SFNs have a
> tilde character in them. Is this true?
Not all SFN - especially if LFN = SFN:-) Say A.doc
NTFS and FAT preserve case but don’t pay any attention to it. I seem
to recall that there is some switch for NTFS that will make it work
case sensitive.
I don’t recall such switch (but it might exist), however, POSIX
rules could be applied so that case sensitivity is on - this would cause
problems with most common utilities (including Explorer - at least in
Windows NT/2000, which is the last time I’ve ever played with that)
If a file is created with POSIX semantics, then case sensitivity
is enforced on that file - if it is not, it is not enforced.
IRP_MJ_DIRECTORY_CONTROL/IRP_MN_QUERY_DIRECTORY when
> one doesn’t exist?
I don’t have my code in front of me, but I believe that if the short
name field is empty then the long name is the same as the short name.
It might be the other way around.
IIRC, yes - SFN empty.
–
Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32
developers.
Alfa File Monitor - File monitoring library for Win32 developers.
> * I saw somewhere in the archives someone saying that ALL SFNs have a
tilde character in them. Is this true?
Not necessary.
* If a file is created with a name that would qualify as an SFN and an
LFN, is it assigned to both LFN and SFN by the FSD, if it is a FSD that
supports both, the different being one is case sensitive?
SFNs are uppercase, note this. So, if the filename is a valid SFN and is
uppercase, then FASTFAT will not create any LFNs for it. Otherwise, a LFN will
be created, possibly to maintain the case only.
NTFS has bit flags on names - “short name” and “long name”. So, I expect NTFS
to create 1 name entry if this is a valid uppercase SFN, and set both flags on
it.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
> NTFS and FAT preserve case but don’t pay any attention
to it. I seem to recall that there is some switch for
NTFS that will make it work case sensitive.
IIRC this is because CreateFile is mapped to ZwCreateFile with
OBJ_CASE_INSENSITIVE flag on. Use POSIX subsystem to access the files in
case-sensitive mode.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
> * I saw somewhere in the archives someone saying that
* ALL SFNs have a
tilde character in them. Is this true?
You may set the variable NoNameNumericTail=dword:1 in the
registry (Unfortunately, I don’t know the key name). Then you
will probably never get the short name with tilde character.
L.
–
Vyhraj Ford Fiesta s klimatizac? a dal?? ceny!
V?ce na http://soutez.volny.cz
In Windows 2003 Server (and maybe XP too), calling ZwCreateFile with
OBJ_CASE_INSENSITIVE off (implying case-sensitive semantics) will not
necessarily produce case-sensitive behavior. The DDK documentation says:
OBJ_CASE_INSENSITIVE
If this flag is specified, a case-insensitive comparison is used when
matching the ObjectName parameter against the names of existing objects.
Otherwise, object names are compared using the default system settings.
I’ve found the “system default” for Windows 2003 to be case-INsensitive,
changeable by a registry setting.
Carl
“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
>
> > NTFS and FAT preserve case but don’t pay any attention
> > to it. I seem to recall that there is some switch for
> > NTFS that will make it work case sensitive.
>
> IIRC this is because CreateFile is mapped to ZwCreateFile with
> OBJ_CASE_INSENSITIVE flag on. Use POSIX subsystem to access the files in
> case-sensitive mode.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>