Hi
I am developing NFS server on windows and want to generate a unique file id for clients to access it. Now as volume id and Inode number can identify a file on Unix File System permenantly.Do we have something similar in NTFS? I searched and found that there is this FRN(file reference no) stored as 64 bit no. 48 bits for file recornd no (MFT Index I think) and 16 bits for sequence no. in case same MFT entry is used again by some new file in place of old deleted file. I found that the function GetFileInformationByHandle returns FRN but it says the file should be open for that(file handle), and its not guranteed that you always get a same FRN no in case you reboot. What I think is since MFT never gets defragmented the FRN no should remain same ideally. like inodes, So is there any way to solve this. Am I thinking in the right direction abt MFT and its defragmentation? If I do defragmentation of drive does that affect MFT?
Can you give me some pointers please, some API’s? I think after searching msdn,google, google groups I am stuck.
Thanks
Mrunal
Jiyo cricket on Yahoo! India cricket
At the kernel level, call ZwQueryDirectoryFile with
FileIdBothDirectoryInformation or FileIdFullDirectoryInformation. Or use
ZwQueryInformationFile (or FltQueryInformationFile for mini-filters) with
FileInternalInformation.
These return the file id for a file. It is persistent on NTFS volumes, but
can change on FAT volumes when defragmented.
Ken
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mrunal Gawade
Sent: Friday, February 03, 2006 6:47 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] NTFS unique file Identifier like Inode?
Hi
I am developing NFS server on windows and want to generate a
unique file id for clients to access it. Now as volume id and Inode number
can identify a file on Unix File System permenantly.Do we have something
similar in NTFS? I searched and found that there is this FRN(file reference
no) stored as 64 bit no. 48 bits for file recornd no (MFT Index I think) and
16 bits for sequence no. in case same MFT entry is used again by some new
file in place of old deleted file. I found that the function
GetFileInformationByHandle returns FRN but it says the file should be open
for that(file handle), and its not guranteed that you always get a same FRN
no in case you reboot. What I think is since MFT never gets defragmented the
FRN no should remain same ideally. like inodes, So is there any way to solve
this. Am I thinking in the right direction abt MFT and its defragmentation?
If I do defragmentation of drive does that affect MFT?
Can you give me some pointers please, some API’s? I think after
searching msdn,google, google groups I am stuck.
Thanks
Mrunal
Jiyo cricket on Yahoo! India cricket
http:ket/> — Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
ntfsd as: xxxxx@comcast.net To unsubscribe send a blank email to
xxxxx@lists.osr.com</http:>
Mrunal
The subject of the uniqueness of this file identifier has come up on this
list a few times over the past few years. I suggest a search for terms like
FileInternalInformation for example.
Good luck
Lyndon
“Mrunal Gawade” wrote in message
news:xxxxx@ntfsd…
Hi
I am developing NFS server on windows and want to generate a
unique file id for clients to access it. Now as volume id and Inode number
can identify a file on Unix File System permenantly.Do we have something
similar in NTFS? I searched and found that there is this FRN(file reference
no) stored as 64 bit no. 48 bits for file recornd no (MFT Index I think) and
16 bits for sequence no. in case same MFT entry is used again by some new
file in place of old deleted file. I found that the function
GetFileInformationByHandle returns FRN but it says the file should be open
for that(file handle), and its not guranteed that you always get a same FRN
no in case you reboot. What I think is since MFT never gets defragmented the
FRN no should remain same ideally. like inodes, So is there any way to solve
this. Am I thinking in the right direction abt MFT and its defragmentation?
If I do defragmentation of drive does that affect MFT?
Can you give me some pointers please, some API’s? I think after
searching msdn,google, google groups I am stuck.
Thanks
Mrunal
Jiyo cricket on Yahoo! India cricket
> I am developing NFS server on windows and want to generate a
unique
file id for clients to access it. Now as volume id and Inode number can
identify a
file on Unix File System permenantly.Do we have something similar in NTFS? I
searched and found that there is this FRN(file reference no) stored as 64 bit
no.
48 bits for file recornd no (MFT Index I think) and 16 bits for sequence no.
in
case same MFT entry is used again by some new file in place of old deleted
file. I found that the function GetFileInformationByHandle returns FRN but it
says
the file should be open for that(file handle), and its not guranteed that you
always
get a same FRN no in case you reboot.
For NTFS, the FileNos are 100% persistent and forever. The remark about FileNo
being not persistent is about FAT only.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
There is just the small issue that the ntfs file identifiers are not unique
for all time since the 64bit values is ‘recycled’ when the sequence number
field wraps.
“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
>> I am developing NFS server on windows and want to generate
>> a
> unique
>>file id for clients to access it. Now as volume id and Inode number can
> identify a
>>file on Unix File System permenantly.Do we have something similar in
>>NTFS? I
>>searched and found that there is this FRN(file reference no) stored as 64
>>bit
> no.
>>48 bits for file recornd no (MFT Index I think) and 16 bits for sequence
>>no.
> in
>>case same MFT entry is used again by some new file in place of old
>>deleted
>>file. I found that the function GetFileInformationByHandle returns FRN
>>but it
> says
>>the file should be open for that(file handle), and its not guranteed that
>>you
> always
>>get a same FRN no in case you reboot.
>
> For NTFS, the FileNos are 100% persistent and forever. The remark about
> FileNo
> being not persistent is about FAT only.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>