Changeset 52131d3 for fedd/federation


Ignore:
Timestamp:
Sep 20, 2011 9:59:03 AM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, info-ops, master
Children:
66879a0
Parents:
cd360a0
Message:

Really make sure the files are not the same.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/authorizer.py

    rcd360a0 r52131d3  
    461461        Copy src to dest with file mode mode.  May raise exceptions on file ops
    462462        '''
    463 
    464         if dest != src:
     463        same_file = False
     464        try:
     465            ss = os.stat(src)
     466            ds = os.stat(dest)
     467
     468            if  ds.st_ino == ss.st_ino: same_file = True
     469        except EnvironmentError:
     470            pass
     471
     472        if not same_file:
    465473            d = open(dest, 'w')
    466474            s = open(src, 'r')
Note: See TracChangeset for help on using the changeset viewer.