Windows 是否支持每个文件的元数据?
我知道图像、音乐、视频等都支持元数据。我的想法是,我想编写一个下载管理器,将信息添加到我下载的文件中:我下载它的 URL、我下载它的日期和时间,可能还有更多。为此,我需要添加的信息不仅仅是照片和视频。我可以只保存一个隐藏的 .XML 文件,但如果 Windows 已经支持这一点那就更好了。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
NTFS 支持任何文件,称为“备用数据流”。我不太确定它的用途。
您在 JPG(exif 属性)、MP3(ID3 标签)等中看到的元数据都是每种文件格式专有的,Windows 只知道如何读取这些属性。修改/创建/访问日期也是如此。没有一种方法可以存储这些数据。
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.
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.
NTFS 支持元数据,我从来没有想过如何访问它,除了右键单击文件,单击“属性”,然后单击“摘要”可以执行的操作之外。您可以通过单击“值”列来编辑现有元数据。
StackOverflow 上有一个类似的问题: 如何检索图像标签 从其中一个答案中,有一个指向 MSDN 的链接,其中包含 Vista(和 XP)属性系统。
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.
There's a question on StackOverflow that's similar: How do you retrieve image tags From one of the answers there, there's a link to MSDN with more details of the Vista (and XP) Property System.
在您的情况下,您绝对应该使用 NTFS 备用数据流,因为您要附加的信息将否则必须受下载文件格式的支持,并且您希望将此信息添加到任何文件类型。
尽管您必须记住,当保存这些流的文件通过网络传输到非 NTFS 闪存驱动器或任何其他非 NTFS 介质时,隐藏在这些流中的信息可能会丢失。
In your case you should definitely use the NTFS alternate data streams as 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.
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.