tags:

views:

227

answers:

2

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.

+1  A: 

Those symlinks are used by emacs to prevent multiple emacs instances from modifying the same file. The symlink normally goes away when you save the file, but it sounds like fuse-sshfs is interfering with this process since the target of the symlink isn't a real file (it isn't meant to be, but sshfs expects it).

Unfortunately, I don't know of a way to disable this feature or force emacs to store these symlinks in a different directory (I use emacs infrequently and I didn't find anything in the manual), so you may have to just periodically delete them manually I'm afraid.

ZoogieZork
+2  A: 

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.)

Phil
Thanks. Yes. I have reworded the question and added the sshfs tag.
Don