-   Linux - Newbie (
-   -   Mysteriously appearing #files# (

slakmagik 02-22-2003 12:11 AM

Mysteriously appearing #files#
I figure this is a real newbie question, so I'm posting it here. I've got three files in my home directory called #foo# and I was thinking they might be from crashed vim sessions, but I wasn't sure. I checked what seemed relevant in the vim docs but didn't turn up anything. And I tried searching here and didn't turn up anything either, which leads to a second newbie question - do I need to escape or quote characters like '#' on an LQ search?

So does anyone know what's creating these and what the significance of them is? I compared two of the files to regular files of the same names and they are the same until the #foo# file runs out, so I figure I can just delete them. The third file was something I was editing, but I deleted the other copy and all there is is a #foo# file. I'd delete that too, as long as it didn't cause something else to wig out.

fancypiper 02-22-2003 02:25 AM

Some editors make automatic backups of files. Perhaps

man <editor>

might tell what form it uses if it has this feature.

mhearn 02-22-2003 09:21 AM

Yeah, I get them too. They are just backups, you can delete them if you don't want them

Dark_Helmet 02-22-2003 01:43 PM

From my experience with emacs, they are backup files. As you edit a file, if a certain amount of time passes, it saves the current buffer and adds the #'s to signify it's a backup. When you choose to save the file, the backup is automatically deleted. If you exit the editor with changes that are unsaved, then the backup file remains. Then next time you open that file, you may get a message asking you if you want to load the backup instead of the original.

You can delete them, but it will get tedious if they're a frequent problem. It'd be best to turn the backup feature off, get in the habit of saving often, or undo until you get back to the last spot you saved the file at.

slakmagik 02-23-2003 03:11 AM

Ah, thanks everybody. No wonder I couldn't find anything in the vim pages if it was emacs. I was thinking vim did a foo~ for backups (my directory's full of those, but that's fine), but thought these might indicate a particular kind of backup or something. But they must have been from when I was trying emacs out. Cool. I'll delete them without worrying about it then. :)

Dark_Helmet 02-23-2003 11:26 AM

Vim may do the same thing... I can't honestly say. I do know that emacs wil make the ~ backups as well. The difference being, the ~ files are the last saved version of the file. The # files contain edits that have not been saved.

Soooo, for the sake of beating this horse just a bit more... When you edit a file the ~ file is left unaltered, but the # file is created, saving your current edits. When you choose to save the file, the ~ file is updated to hold the previous save and the # file is deleted...

Again, this is emacs behavior, but I would bet vim could be configured to behave the same way... perhaps it's default behavior.

slakmagik 02-24-2003 03:00 AM

I ran the file I'd deleted through emacs and that's exactly it - it told me the file didn't exist but there was a version I could recover, so I did, just for the practice. That's a cool system. One thing I hate about DOS/Win stuff is you invariably have to configure it to save backups, which are off by default - if it'll do backups at all. With Windows crashing all the time, no I don't want backups. It's not like I value my work or anything. :rolleyes: With most Linux editors, you get auto backups and sometimes a pair of them. :) Thanks for the explanation about which was which and why.

All times are GMT -5. The time now is 11:44 PM.