Show More
@@ -490,7 +490,20 b' class cachestat(object):' | |||||
490 |
|
490 | |||
491 | def __eq__(self, other): |
|
491 | def __eq__(self, other): | |
492 | try: |
|
492 | try: | |
493 | return self.stat == other.stat |
|
493 | # Only dev, ino, size, mtime and atime are likely to change. Out | |
|
494 | # of these, we shouldn't compare atime but should compare the | |||
|
495 | # rest. However, one of the other fields changing indicates | |||
|
496 | # something fishy going on, so return False if anything but atime | |||
|
497 | # changes. | |||
|
498 | return (self.stat.st_mode == other.stat.st_mode and | |||
|
499 | self.stat.st_ino == other.stat.st_ino and | |||
|
500 | self.stat.st_dev == other.stat.st_dev and | |||
|
501 | self.stat.st_nlink == other.stat.st_nlink and | |||
|
502 | self.stat.st_uid == other.stat.st_uid and | |||
|
503 | self.stat.st_gid == other.stat.st_gid and | |||
|
504 | self.stat.st_size == other.stat.st_size and | |||
|
505 | self.stat.st_mtime == other.stat.st_mtime and | |||
|
506 | self.stat.st_ctime == other.stat.st_ctime) | |||
494 | except AttributeError: |
|
507 | except AttributeError: | |
495 | return False |
|
508 | return False | |
496 |
|
509 |
General Comments 0
You need to be logged in to leave comments.
Login now