##// END OF EJS Templates
util: make filestat.avoidambig() return whether ambiguity is avoided or not
FUJIWARA Katsunori -
r32746:77f354ae default
parent child Browse files
Show More
@@ -1568,7 +1568,10 b' class filestat(object):'
1568 'old' should be previous filestat of 'path'.
1568 'old' should be previous filestat of 'path'.
1569
1569
1570 This skips avoiding ambiguity, if a process doesn't have
1570 This skips avoiding ambiguity, if a process doesn't have
1571 appropriate privileges for 'path'.
1571 appropriate privileges for 'path'. This returns False in this
1572 case.
1573
1574 Otherwise, this returns True, as "ambiguity is avoided".
1572 """
1575 """
1573 advanced = (old.stat.st_mtime + 1) & 0x7fffffff
1576 advanced = (old.stat.st_mtime + 1) & 0x7fffffff
1574 try:
1577 try:
@@ -1577,8 +1580,9 b' class filestat(object):'
1577 if inst.errno == errno.EPERM:
1580 if inst.errno == errno.EPERM:
1578 # utime() on the file created by another user causes EPERM,
1581 # utime() on the file created by another user causes EPERM,
1579 # if a process doesn't have appropriate privileges
1582 # if a process doesn't have appropriate privileges
1580 return
1583 return False
1581 raise
1584 raise
1585 return True
1582
1586
1583 def __ne__(self, other):
1587 def __ne__(self, other):
1584 return not self == other
1588 return not self == other
General Comments 0
You need to be logged in to leave comments. Login now