PreserveNTFSReparsePoints

From RdiffBackupWiki

Jump to: navigation, search

In the future, we should backup and restore reparse points properly. Reading them involves like this:

hfile = win32file.CreateFile("c:\Users\Default User", win32con.GENERIC_READ, win32con.FILE_SHARE_READ, None, win32con.OPEN_EXISTING, win32con.FILE_FLAG_BACKUP_SEMANTICS|win32con.FILE_FLAG_OPEN_REPARSE_POINT, None)
buf = win32file.DeviceIoControl(hfile, winioctlcon.FSCTL_GET_REPARSE_POINT, '', winnt.MAXIMUM_REPARSE_DATA_BUFFER_SIZE, None)

and then parsing the appropriate string out of the buffer. The buffer (REPARSE_DATA_BUFFER) is defined here:

http://msdn.microsoft.com/en-us/library/ms791514.aspx

The python struct module is useful for defining a buffer data structure. An open question is: Do all NTFS reparse points function this same way? Can a hardlink and a Vista symlink be created via the same mechanism? (That is, can we use the rdiff-backup 'sym' type for all NTFS junctions? Or would a new datatype be needed?)


See also:

http://msdn.microsoft.com/en-us/library/aa365507(VS.85).aspx

http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx

http://msdn.microsoft.com/en-us/library/aa365503(VS.85).aspx

http://msdn.microsoft.com/en-us/library/aa363940(VS.85).aspx


This suggestion grew out of the support request: https://savannah.nongnu.org/support/index.php?106584

Personal tools