ellie: transparent remount on stale FUSE mount

This commit is contained in:
Levi Neely 2026-05-21 09:00:06 +02:00
parent de3d08ce14
commit d97f4c4f42
1 changed files with 22 additions and 7 deletions

View File

@ -108,16 +108,31 @@ Signals `user-error' if no session is active."
;;;; ──────────────── Low-level file helpers ──────────────── ;;;; ──────────────── Low-level file helpers ────────────────
(defun ellie--remount ()
"Run ollie-remount to recover a stale FUSE mount."
(call-process "ollie-remount" nil nil nil))
(defun ellie--fwrite (path text) (defun ellie--fwrite (path text)
"Write TEXT to PATH, suppressing the minibuffer message." "Write TEXT to PATH, retrying after remount on failure."
(write-region text nil path nil 'silent)) (condition-case nil
(write-region text nil path nil 'silent)
(file-error
(ellie--remount)
(write-region text nil path nil 'silent))))
(defun ellie--fread (path) (defun ellie--fread (path)
"Return the contents of PATH as a string, or nil if it does not exist." "Return the contents of PATH as a string, retrying after remount on failure."
(when (file-exists-p path) (condition-case nil
(with-temp-buffer (when (file-exists-p path)
(insert-file-contents path) (with-temp-buffer
(buffer-string)))) (insert-file-contents path)
(buffer-string)))
(file-error
(ellie--remount)
(when (file-exists-p path)
(with-temp-buffer
(insert-file-contents path)
(buffer-string))))))
;;;; ──────────────── Session enumeration ──────────────── ;;;; ──────────────── Session enumeration ────────────────