Tolerate vanished files
This commit is contained in:
parent
c619e74e15
commit
29491e1639
6
kitsune
6
kitsune
|
@ -90,9 +90,15 @@ def watch(args):
|
||||||
for ln in lines:
|
for ln in lines:
|
||||||
print(f"{f.path:{filename_length}}", format_ts(f.last_ts), dead, ln)
|
print(f"{f.path:{filename_length}}", format_ts(f.last_ts), dead, ln)
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
stf = os.stat(f.path)
|
stf = os.stat(f.path)
|
||||||
if stf.st_ctime_ns != f.st_ctime_ns:
|
if stf.st_ctime_ns != f.st_ctime_ns:
|
||||||
f.reopen()
|
f.reopen()
|
||||||
|
except FileNotFoundError:
|
||||||
|
# ignore,
|
||||||
|
# or maybe remove from watched_files?
|
||||||
|
# or just mark as deleted?
|
||||||
|
pass
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
seek_to_end = False
|
seek_to_end = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue