diff --git a/kitsune b/kitsune index e4eacca..a383a64 100755 --- a/kitsune +++ b/kitsune @@ -64,6 +64,7 @@ def watch(args): stf = os.stat(f.path) if stf.st_ino != st.st_ino: f.reopen() + st = os.stat(f.fileno) except FileNotFoundError: # ignore, # or maybe remove from watched_files? @@ -74,13 +75,14 @@ def watch(args): # We are beyond the end of the file, so it has probably # been truncated and rewritten - read from beginning f.fd.seek(0, 0) + dead = "✝" if st.st_nlink == 0 else " " f.last_ts = st.st_mtime_ns new_content = f.fd.read() lines = new_content.split("\n") if lines[-1] == "": lines.pop() for ln in lines: - print(f"{f.path:{filename_length}}", format_ts(f.last_ts), ln) + print(f"{f.path:{filename_length}}", format_ts(f.last_ts), dead, ln) time.sleep(0.1) seek_to_end = False