Does folders in windows have IDs? or GUIDs?

旧街凉风 提交于 2019-12-10 22:46:33

问题


what I'm trying to do, I'm selecting a folder and copying it, I would like to avoid copying it again if the folder got renamed. so is there an ID for each folder in windows that stick with the folder till its deleted ?

C# would be perfect, or C++


回答1:


I think you looking somewhat like this :Unique file ids for Windows - Unique ID for files on NTFS?

Windows can give a unique file indentifier using the function GetFileInformationByHandle()

Example: (hFile is a handle to a file)

BY_HANDLE_FILE_INFORMATION FileInfo;

GetFileInformationByHandle(hFile, &FileInfo);
inode= FileInfo.nFileIndexLow | (FileInfo.nFileIndexHigh << 32);
volume=FileInfo.dwVolumeSerialNumber;

I got similar SO thread here, that will help you implement that you are looking for..

Unique File Identifier ane Unique Folder Identifier




回答2:


I dont think there is a way to find out for folders.



来源:https://stackoverflow.com/questions/10680379/does-folders-in-windows-have-ids-or-guids

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!