Windows 是否支持每个文件的元数据?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1556382/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:16:33  来源:igfitidea点击:

Does Windows support metadata for every file?

windowsmetadata

提问by esac

I know things like images, music, videos support metadata. My idea is that I want to write a download manager that adds info to the files I download: the URL I downloaded it from, the date and time I downloaded it, possibly some more. For this to work I need to add info for more than just photos and videos. I could just save a hidden .XML flie, but if Windows supports this already then it would be better.

我知道图像、音乐、视频等支持元数据。我的想法是我想编写一个下载管理器,为我下载的文件添加信息:我下载它的 URL,我下载它的日期和时间,可能还有更多。为此,我需要添加的信息不仅仅是照片和视频。我可以只保存一个隐藏的 .XML 文件,但如果 Windows 已经支持它,那就更好了。

采纳答案by Mark Henderson

There is a thing called an "Alternate Data Stream" which NTFS supprorts for any file. I'm not really sure what it's meant to be used for though.

有一种叫做“备用数据流”的东西,NTFS 支持任何文件。我不太确定它的用途是什么。

The metadata that you see in JPG's (exif properties), MP3s (ID3 Tags) and whatnot are all proprietary to each file format, and Windows simply knows how to read those properties. Same goes for Modifed/Created/Accessed dates. There is no one method of storing this data.

您在 JPG(exif 属性)、MP3(ID3 标签)等中看到的元数据都是每种文件格式的专有内容,而 Windows 只知道如何读取这些属性。修改/创建/访问日期也是如此。没有一种方法可以存储这些数据。

回答by Ward - Reinstate Monica

NTFS supports metadata, I've never thought about how to access it beyond what you can do by right-clicking on a file, clicking Properties and then Summary. You can edit existing metadata by clicking on the Value column.

NTFS 支持元数据,我从来没有想过如何通过右键单击文件、单击属性然后单击摘要来访问它。您可以通过单击“值”列来编辑现有元数据。

There's a question on StackOverflow that's similar: How do you retrieve image tagsFrom one of the answers there, there's a link to MSDN with more details of the Vista (and XP) Property System.

StackOverflow 上有一个类似的问题:How do you retrieve image tags从那里的一个答案中,有一个指向 MSDN 的链接,其中包含有关Vista(和 XP)属性系统的更多详细信息

回答by macbirdie

In your case you should definitely use the NTFS alternate data streamsas the information you want to attach would otherwise have to be supported by the downloaded file's format and you want to add this information to any file type.

在您的情况下,您绝对应该使用NTFS 备用数据流,因为您要附加的信息必须由下载的文件格式支持,并且您希望将此信息添加到任何文件类型。

Although you have to remember that information hidden in those streams may be lost when the file holding it is transferred over the network, to a non-NTFS flash drive or any other non-NTFS medium.

尽管您必须记住,当保存这些流的文件通过网络传输到非 NTFS 闪存驱动器或任何其他非 NTFS 介质时,隐藏在这些流中的信息可能会丢失。