mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-28 10:49:16 +00:00
Merge pull request #1367 from PlasmaPower/noatime-fix
Fixed noatime detection
This commit is contained in:
commit
91a9c35bd3
1 changed files with 2 additions and 1 deletions
|
@ -393,7 +393,8 @@ def test_atime(self):
|
||||||
def has_noatime(some_file):
|
def has_noatime(some_file):
|
||||||
atime_before = os.stat(some_file).st_atime_ns
|
atime_before = os.stat(some_file).st_atime_ns
|
||||||
try:
|
try:
|
||||||
os.close(os.open(some_file, flags_noatime))
|
with open(os.open(some_file, flags_noatime)) as file:
|
||||||
|
file.read()
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue