While working through two active buffers in Emacs, sum.cpp
and template.cpp
, I accidentally shut down my laptop (Ubuntu 15.04 (Vivid Vervet)) without closing Emacs, and without saving these two files.
When I restarted the laptop and listed directory content in Emacs by C - x C - f /C++/
, I got the following.
What does the line mean after .#sum.cpp?
lrwxrwxrwx 1 anupam anupam 41 Aug 6 00:53 .#sum.cpp -> [email protected]:1438790786
I know Emacs saves the unsaved buffer by # by autosave
, but when accessing #sum.cpp
why is it showing the following?
file is a symlink to non-existent target?
The autosaved file is #sum.cpp#
. The symlink .#sum.cpp
is used by Emacs to store some internal data (seems like user name, host name and some timestamp)
As the target of a symlink is just some short text (that is resolved as a path if you access the symlink's content), symlinks are sometimes used to store small amounts of data. In that case the target most likely isn't a valid file path and you get an error if you try to access it.
That's because creating a symlink is an atomic operation: Either the symlink is created with full content or it's not created at all. In contrast creating a regular file and filling it with content is not atomic and in case of an error you may end up with an empty file or only partial content.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments