By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,402 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,402 IT Pros & Developers. It's quick & easy.

NTFS reparse points

P: n/a
I want to create a reparse point on NTFS (any).

Here
(http://msdn.microsoft.com/library/de...rse_points.asp)
I read: "reparse points are used to implement NTFS file system links".
Here
(http://msdn.microsoft.com/library/de..._junctions.asp)
I read: "Soft links are implemented through reparse points".

However I can't see FILE_ATTRIBUTE_REPARSE_POINT turned on in any file /
directory shortcuts I create. In fact the only attribute set in
shortcuts created using Windows Explorer is FILE_ATTRIBUTE_ARCHIVE. (I
am using GetFileAttributes() to examine this.)

The questions are:

(1) Why is that so?
(2) Does anybody have any idea (sample code?) on how to create a reparse
point (the simpler, the better) using Python?

I am using Windows 2000 Professional, Python 2.4 and Mark Hammond's
Python for Windows Extensions build 204.

Thank you.

+-------------------------------------------------------+
| When replying, please replace "my_initials" in the |
| From: address field with my initials - that is, "SF". |
+-------------------------------------------------------+

--
http://www.nglogic.com
Enter through the narrow gate! (Mt 7:13-14)
Nov 3 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Stanislaw Findeisen wrote:
(2) Does anybody have any idea (sample code?) on how to create a reparse
point (the simpler, the better) using Python?


The only sample code I've seen for creating reparse points is in c or c++
and its quite a messy operation. See
http://www.sysinternals.com/Utilities/Junction.html for some sample code.

The easy way to do it from Python is just to make sure you have a program
such as junction on your system then use os.system('junction "%s" "%s"' %
(directory, target))

Be careful if you start creating junctions: Windows explorer doesn't
understand them: if you try to delete a folder which is actually a junction
it first deletes all the files inside the folder so the original folder
ends up empty as well.
Nov 3 '05 #2

P: n/a
Stanislaw Findeisen wrote:
I want to create a reparse point on NTFS (any).

Here
(http://msdn.microsoft.com/library/de...rse_points.asp)
I read: "reparse points are used to implement NTFS file system links".
Here
(http://msdn.microsoft.com/library/de..._junctions.asp)
I read: "Soft links are implemented through reparse points".

However I can't see FILE_ATTRIBUTE_REPARSE_POINT turned on in any file /
directory shortcuts I create. In fact the only attribute set in
shortcuts created using Windows Explorer is FILE_ATTRIBUTE_ARCHIVE. (I
am using GetFileAttributes() to examine this.)

The questions are:

(1) Why is that so?


Because shortcuts aren't reparse points. They're just small files that
contain some information about the file or directory they point to and
how to open it.

--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton

Roel Schroeven
Nov 3 '05 #3

P: n/a
In article <dk**********@achot.icm.edu.pl>,
Stanislaw Findeisen <my*********@nglogic.com> wrote:
...
However I can't see FILE_ATTRIBUTE_REPARSE_POINT turned on in any file /
directory shortcuts I create. In fact the only attribute set in
shortcuts created using Windows Explorer is FILE_ATTRIBUTE_ARCHIVE. (I
am using GetFileAttributes() to examine this.)

...

Shortcuts are files with a .lnk extention. Reparse points are NTFS
directory data.
__________________________________________________ ______________________
TonyN.:' *firstname*nlsnews@georgea*lastname*.com
' <http://www.georgeanelson.com/>
Nov 3 '05 #4

P: n/a
You should be able to use win32file.DeviceIoControl with
winioctlcon.FSCTL_SET_REPARSE_POINT to do this.
(winioctlcon was added in build 205)
The hard part is going to be constructing the
REPARSE_GUID_DATA_BUFFER struct to pass in
as the buffer.

hth
Roger

"Stanislaw Findeisen" <my*********@nglogic.com> wrote in message news:dk**********@achot.icm.edu.pl...
I want to create a reparse point on NTFS (any).

Here (http://msdn.microsoft.com/library/de...rse_points.asp) I read: "reparse points
are used to implement NTFS file system links". Here
(http://msdn.microsoft.com/library/de..._junctions.asp) I read: "Soft links
are implemented through reparse points".

However I can't see FILE_ATTRIBUTE_REPARSE_POINT turned on in any file / directory shortcuts I create. In fact the only
attribute set in shortcuts created using Windows Explorer is FILE_ATTRIBUTE_ARCHIVE. (I am using GetFileAttributes() to
examine this.)

The questions are:

(1) Why is that so?
(2) Does anybody have any idea (sample code?) on how to create a reparse point (the simpler, the better) using Python?

I am using Windows 2000 Professional, Python 2.4 and Mark Hammond's Python for Windows Extensions build 204.

Thank you.

+-------------------------------------------------------+
| When replying, please replace "my_initials" in the |
| From: address field with my initials - that is, "SF". |
+-------------------------------------------------------+

--
http://www.nglogic.com
Enter through the narrow gate! (Mt 7:13-14)


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 5 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.