哪里windows资源管理器存储文件的元数据?资源管理器、文件、数据、windows

2023-09-03 13:01:59 作者:咬字分开念

在Windows 7中,我可以的元数据添加到例如标题,评级等文件。凡也正是这个存储元数据?对于NTFS他们可能会使用备用数据流,但我这个元数据还发生在FAT32工作,所以他们怎么浩办呢?是否有一个API来使用此功能?

解决方案   

在Windows 7中,我可以的元数据添加到文件的[使用资源管理器]例如标题,评级等。凡也正是这个存储元数据?

圣诞节特辑

该元数据被调用的属性的。它已经可以通过这种方式,因为Windows Vista中。

Windows资源管理器presents以统一的方式的属性,这可能会欺骗你以为他们都来自同一个车间来了。但这种情况并非如此。

属性都经由API暴露于程序员。 (见下文。)

到底在哪它们存储是一个实现细节。这取决于文件类型和种类的财产。例如,文件系统的时间戳被暴露作为属性。媒体文件的元数据,如EXIF的图像或ID3标签的MP3存储在文件本身的研究。还有其他元数据可能存储在伴随其属性你检查文件的XML文件。

那么,是它存储?答案是:这要看,而且你真的不担心,也不应该你就放心吧。因为,正如我所说,这是一个实现细节,并就规划的推移,担心实施细节意味着绕过了API。

也没有必要担心,其属性时,与他们在API级别处理存储。请参阅 IShellItem2 和的 IPropertyStore COM接口,一个入口点。

引擎盖下,Windows Vista和更高版本船舶的属性处理程序的是了解文件类型,以及如何读取和写入它们的属性。你可以写你自己的(使用COM)的属性,处理程序,并把它添加到浏览器(如所谓的外壳扩展的)。

我已经发现的最有用的文档是本·卡拉斯的博客围绕着Vista发布的时间条目开始于2006年8月。他做了一系列的产权制度。这是一个非常有用的教程,并使用Windows 7对我来说,它一直100%。

不要按照此页面上的另一个答复给出的建议读了有关的 COM结构化存储的。这是只针对特定的文件类型。在本·卡拉斯的字< /一>:

  

疑难杂症:很多人误叫 StgOpenStorageEx 。别这样! StgOpenStorageEx 是仅的支持特定格式,如OLE复合文档或NTFS二次流存储。 StgOpenStorageEx 不知道如何读从 .JPG 图像EXIF头。

In Windows 7 I can add meta data to files for example title, rating and so on. Where is this meta data stored exactly? For NTFS they may use alternate data streams but I this meta data also happen to work in FAT32, so how ho they do it? Is there an API to make use of this feature?

解决方案

In Windows 7 I can add meta data to files [using Explorer] for example title, rating and so on. Where is this meta data stored exactly?

This metadata is called properties. It has been available in this way since Windows Vista.

Windows Explorer presents properties in a unified way, which might trick you into thinking that they're all coming from the same shop. But this is not the case.

Properties are exposed to the programmer via an API. (See below.)

Where exactly they're stored is an implementation detail. It depends on the filetype and on the kind of property. For example, filesystem timestamps are exposed as properties. Media file metadata such as EXIF for images or ID3 tags for MP3 is stored in the file itself. Still other metadata might be stored in an XML file accompanying the file whose properties you're inspecting.

So where is it stored? The answer is: It really depends, and you really don't have to worry, nor should you worry. Because, as I said, it is an implementation detail, and as far as programming goes, worrying about implementation details means bypassing the API.

Neither do you have to worry where properties are stored when dealing with them at the API level. See the IShellItem2 and IPropertyStore COM interfaces for an entry point.

Under the hood, Windows Vista and later versions ship property handlers that know about filetypes and how to read and write their properties. You could write a property handler of your own (using COM) and add it to Explorer (as a so-called shell extension).

The most useful documentation which I've found is Ben Karas' blog entries around the time of the Vista release starting in August 2006. He's done a whole series on the property system. It's a very useful tutorial, and for me using Windows 7, it has worked 100 %.

Don't follow the advice given in another reply on this page to read up about COM Structured Storage. This is only for specific filetypes. In the words of Ben Karas:

Gotcha: Many people mistakenly call StgOpenStorageEx. Don't do that! StgOpenStorageEx is only supported for specific formats like OLE Compound Documents or NTFS secondary stream storage. StgOpenStorageEx doesn't know how to read the EXIF header from a .JPG image.

 
精彩推荐
图片推荐