473,230 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

Accessing Windows file metadata?

EP
I'm looking for a method by which to access Windows files metadata and
have not been able to find anything in the standard modules or via
Google - what is the standard approach?

Shamefully I really do not understand Windows file system - e.g. is
properties metadata attached to the file? if I change that metadata
do I change the file's hash? how is the metadata structured? or is
the "properties" metadata simply derived upon access?

Either way, is there a module or method to access this metadata (I'd
hope there was a metadata dictionary for each file, but that may be a
sign I've been spoiled by Python) ?
EP

Jan 11 '06 #1
2 8690
The Pywin32 package wraps the interfaces used to read and
write these properties. \win32com\test\testStorage.py demonstrates
how to use them.

There are actually two different ways that metadata is stored.
For structured storage files created by COM applications, it's
embedded directly in the file data. This would change the file's hash
if the document properties were changed. On volumes formatted
with NTFS 5 (Win2k and later), document properties can be added
to any type of file and are stored in alternate data streams.

hth
Roger

"EP" <er***********@gmail.com> wrote in message news:11**********************@o13g2000cwo.googlegr oups.com...
I'm looking for a method by which to access Windows files metadata and
have not been able to find anything in the standard modules or via
Google - what is the standard approach?

Shamefully I really do not understand Windows file system - e.g. is
properties metadata attached to the file? if I change that metadata
do I change the file's hash? how is the metadata structured? or is
the "properties" metadata simply derived upon access?

Either way, is there a module or method to access this metadata (I'd
hope there was a metadata dictionary for each file, but that may be a
sign I've been spoiled by Python) ?
EP



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jan 12 '06 #2

Probably somebody more deeply into this will soon give you a better answer,
but I'll
try to give a better-than-nothing answer.

The Properties metadata that you see in the shell can come from several places.
The oldest, commonest source is from Microsoft Office files. These have a
compound
structure associated with OLE Object Linking and Embedding and the metadata
is just one
of a lot of things stuck in there besides the Word text or Excel numbers
you see in the
application.

Getting to it from Python is via COM. See Mark Hammond and Andy Robinson's
book
"Python Programming in Win32" for the general approach. Perhaps the easiest
way to
get this metadata is using DSOFILE.DLL that was released as an example a long
time ago by Microsoft (it's not an OS file, you have to install it yourself).
The following article gives a VBScript example that you can
use as a template for your Python.

http://www.microsoft.com/technet/com...ts/sg0305.mspx

As I said, the OLE metadata has been around for a long time. With Windows
2000, MS
extended the idea to any NTFS file so that you have an open-ended ability to
associate named attributes like author, title, keywords or custom attributes
of your
own to any file on an NTFS partition.

Unfortunately DSOFILE does not help with this (at least I don't think so!),
so you'd need
to deal with the OS at a somewhat uglier level. And obviously you need Win2K
or better.

Look at \win32com\test\testStorage.py in the win32 python package for an
example.

Hope this helps,
John Rhoads

I'm looking for a method by which to access Windows files metadata and
have not been able to find anything in the standard modules or via
Google - what is the standard approach?

Shamefully I really do not understand Windows file system - e.g. is
properties metadata attached to the file? if I change that metadata
do I change the file's hash? how is the metadata structured? or is
the "properties" metadata simply derived upon access?

Either way, is there a module or method to access this metadata (I'd
hope there was a metadata dictionary for each file, but that may be a
sign I've been spoiled by Python) ?

EP

Jan 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Denrael | last post by:
I am looking for a way in Python to update Windows File Summary Metadata. By that I mean the data (Title, Subject, Keywords, Comments) found when you right click a windows file, select properties...
17
by: Paul Rubin | last post by:
Dumb question from a Windows ignoramus: I find myself needing to write a Python app (call it myapp.py) that uses tkinter, which as it happens has to be used under (ugh) Windows. That's Windows...
0
by: Nathan Kovac | last post by:
I am stumped once again. Perhaps Nicholas or someone will be able to help me solve this issue. For background you can see my earlier post about timers and windows servcice. That issue was...
6
by: Nathan Kovac | last post by:
Yesterday afternoon I was getting the following errors in a windows service: 'DatabaseManager.DataComponent', 'Error', '3 Errors: Line: 0 - Metadata file 'ScriptingMethods.dll' could not be found...
1
by: Miku | last post by:
Hi Guies, I am new to vb.net. In my project I am using vb.net & MySql 4.0.17 as a backend. For database connectivity i have downloaded ByteFX - Mysql .net native provider. I have written the...
4
by: Jeffrey Barish | last post by:
Is there a way to interact with Windows Media Player from Python? I would like to be able to do things like tell WMP to play a given sound file or to ask WMP for metadata about a sound file. --...
3
by: jreljac | last post by:
Howdy, Is it possible (and if it is how?) to have php display the details of a word/excel/pdf document's properties/metadata? I can go into MS Word...File...Properties and assign things like...
2
by: wileyregister22 | last post by:
When rightclicking a, for example, pdf file on windows, one normally gets a screen with three or four tags. Clicking on one of the summary tag one can get some info like "title", "Author",...
5
by: Luis Zarrabeitia | last post by:
I need to parse a file, text file. The format is something like that: TYPE1 metadata data line 1 data line 2 .... data line N TYPE2 metadata data line 1 ....
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.