Ralf,
The FsRtl tunneling APIs are not what you are looking for – these are
used to help file systems implement tunneling, not to expose the name
tunneling to applications above the file systems.
With Windows XP, there is a new WIN32 API that allows you to set the
short file name for a file, SetFileShortName. This is equivalent to
calling ZwSetFileInformation with the FILE_INFORMATION_CLASS of
FileShortNameInformation.
There are a couple caveats about this – it only works on NTFS and the
user calling this API must have SE_RESTORE_PRIVILEGE in order for this
operation to succeed (this API was added to help out backup-type
applications).
Previous to Windows XP, there is no mechanism for explicitly setting the
short name on a file on any of the file systems that ship with the OS.
Thanks,
Molly Brown
Microsoft Corporation
This posting is provided “AS IS” with no warrenties and confers no
rights.
-----Original Message-----
From: Ralf Buschmann [mailto:xxxxx@backmagic.de]
Sent: Monday, February 11, 2002 5:03 AM
To: File Systems Developers
Subject: [ntfsd] Re: FsRtlAddToTunnelCache
Maxim,
you wrote on Monday, February 11, 2002, 13:32:05:
>> in a user mode application, I need to copy a file and preserve its
short
>> file name. I came across the “tunneling” APIs such as
>> FsRtlInitializeTunnelCache, FsRtlAddToTunnelCache etc. Basically, as
I
>> understand it, once a long file name has been added to the tunnel
cache,
>> you can open the file by its short name, copy/rename it, and the
long
>> file name will be dragged along. Is this correct?
MSS> Open the destination file with proper disposition.
MSS> This will truncate the data, but leave the name + MFT record
intact.
MSS> Then write to this file.
Sorry, looks like I didn’t make myself clear. I understand what you are
saying but that’s not the issue here. My problem is that I’m creating a
new file and need a way to control its short name. For example I have
files
c:\src\Long Name 1.txt
c:\src\Long Name 2.txt
Now I need to copy “c:\src\Long Name 2.txt” to directory c:\dest which
is empty. But in c:\dest, “Long Name 2.txt” will have the short file
name longna~1.txt, not longna~2.txt. I want to keep the original short
file name, if possible.
Ralf.
—
You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com