[python-win32] Question on parsing Reparse Points
Tim Golden
mail at timgolden.me.uk
Fri Mar 20 10:58:38 CET 2009
Philip Bloom wrote:
> Hello,
>
> This is my first post the python win32 programming list, so hello.
>
> I'm trying to figure out a way to tell where a Reparse Point
> (<JUNCTION>) is really pointing programmatically. I can determine
> pretty easily a folder is a Junction
> (win32api.GetFileAttributes(folder)==1040), but from there, I can't seem
> to find a way to tell where that reparse point is reparsing into. I've
> seen C++ code that does it, but it depends on FindFirstFile, which I
> don't see in win32api or win32file for python.
You'll need to use the DeviceIoControl function, exposed in
win32file from the pywin32 package. I don't think I've got
an example to hand, but you can pretty much transliterate
any C++ code. You'll have to roll your own structures, tho'.
There's a (random) example here in case it helps:
http://www.flexhex.com/docs/articles/hard-links.phtml
If I get the chance I'll put an example together.
FindFirstFile, btw, is sort-of exposed via win32file.FindFilesIterator
which wraps it and its companions as a Python iterator.
TJG
More information about the python-win32
mailing list