Search code examples
emacssshfsfuser

Why does sshfs cause these Emacs artifacts?


After opening a file in emacs (over an ssh tunneled, sshfs mounted file system) I get symbolic links like this:

.#jobid.php -> [email protected]:1260471633

We have determined that these are emacs LOCK files.

The sshfs filessystem is mounted with follow_symlinks and transform_symlinks, but it appears to be refusing to return the link 'text' via readlink so emacs is not removing them.


Solution

  • In case you're looking for documentation, Emacs refers to these files as file locks.

    Instead of using sshfs/FUSE, you can access remote files directly from Emacs:

    C-x C-f /ssh:host.name:/path/to/file RET
    

    Emacs doesn't create file locks when editing remote files in this manner-- search for "TRAMP" for more info about editing remote files. (Unfortunately, I guess Emacs can't tell that your FUSE mountpoint is backed by a remote filesystem or that creating file locks on it is problematic.)