diff options
author | owsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2008-12-22 16:57:41 +0000 |
---|---|---|
committer | owsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2008-12-22 16:57:41 +0000 |
commit | 53b282f4333293ed897f81cddc77c4b5d873a285 (patch) | |
tree | db2bdadefc4e7b46530a8fb44982aa20069306d0 /rdiff-backup/rdiff_backup/rpath.py | |
parent | e601a12bfe58ac74f2e510f063e7ee93f5e9359e (diff) | |
download | rdiff-backup-53b282f4333293ed897f81cddc77c4b5d873a285.tar.gz |
Prevent backing-up reparse points on Windows
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@977 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/rpath.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/rpath.py | 10 |
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]) |