views:

144

answers:

3

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.

+2  A: 

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.

Ward
In Windows XP, the information from Summary tab is stored in a NTFS stream named `\x05SummaryInformation` (the \x05 means byte 0x05 in hex, for the non-programmers here). But this will not be used if a file supports _embedding_ information (such as Microsoft Office binary documents, or MP3 ID3 tags).
grawity
+1  A: 

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.

Farseeker
+1  A: 

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.

macbirdie