summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/rpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/rdiff_backup/rpath.py')
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 3655084..9bcdd2e 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -38,6 +38,10 @@ are dealing with are local or remote.
import os, stat, re, sys, shutil, gzip, socket, time, errno
import Globals, Time, static, log, user_group, C
+try:
+ import win32file, winnt
+except ImportError:
+ pass
class SkipFileException(Exception):
"""Signal that the current file should be skipped but then continue
@@ -328,6 +332,12 @@ def make_file_dict_python(filename):
data['devloc'] = statblock[stat.ST_DEV]
data['nlink'] = statblock[stat.ST_NLINK]
+ if os.name == 'nt':
+ attribs = win32file.GetFileAttributes(filename)
+ if attribs & winnt.FILE_ATTRIBUTE_REPARSE_POINT:
+ data['type'] = 'sym'
+ data['linkname'] = None
+
if not (type == 'sym' or type == 'dev'):
# mtimes on symlinks and dev files don't work consistently
data['mtime'] = long(statblock[stat.ST_MTIME])