summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/rpath.py
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-07-02 18:15:52 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-07-02 18:15:52 +0000
commitb466bcadefdaca409b7052d433d96b304811a0b0 (patch)
tree719df56cd2aeb0de346f5ca132e197cdc2d21d8d /rdiff-backup/rdiff_backup/rpath.py
parentfaf2b8f85c7d06021c5386c3aba0c3f16fb44a26 (diff)
downloadrdiff-backup-b466bcadefdaca409b7052d433d96b304811a0b0.tar.gz
Use the Python os.lstat() on Windows. (Patch from Josh Nisly)
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@905 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/rpath.py')
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py
index 2acfc32..8871f47 100644
--- a/rdiff-backup/rdiff_backup/rpath.py
+++ b/rdiff-backup/rdiff_backup/rpath.py
@@ -246,7 +246,7 @@ def rename(rp_source, rp_dest):
if not rp_source.lstat(): rp_dest.delete()
else:
if rp_dest.lstat() and rp_source.getinode() == rp_dest.getinode() and \
- rp_source.getinode() != -1:
+ rp_source.getinode() != 0:
log.Log("Warning: Attempt to rename over same inode: %s to %s"
% (rp_source.path, rp_dest.path), 2)
# You can't rename one hard linked file over another
@@ -824,10 +824,13 @@ class RPath(RORPath):
def setdata(self):
"""Set data dictionary using C extension"""
- self.data = self.conn.C.make_file_dict(self.path)
+ try:
+ self.data = self.conn.C.make_file_dict(self.path)
+ except AttributeError:
+ self.data = self.make_file_dict_python()
if self.lstat(): self.conn.rpath.setdata_local(self)
- def make_file_dict_old(self):
+ def make_file_dict_python(self):
"""Create the data dictionary"""
statblock = self.conn.rpath.tupled_lstat(self.path)
if statblock is None: