I often have open log files for bug analysis. I then move on and fix some code. Later I do a rebuild, during which my old log files get deleted. When however I still have the editor open, the build fails, which is annoying.

I would like to know if there is an editor that does not keep a lock on the file, so that other processes can delete it underneath it.

This may seem odd but it would increase my daily productivity quite a lot.

Thanks!

link|improve this question

57% accept rate
For which OS should it be? Or are you looking for recommendations for any platform? – Jonik Aug 11 '09 at 12:20
I wanted to ask openly, as this potentially makes me migrate on a different platform :-) – raoulsson Aug 11 '09 at 12:53
Hey, it's a steath vote-for-your-favourite-editor question! :-) – John Fouhy Aug 19 '09 at 3:37
feedback

8 Answers

up vote 10 down vote accepted

Notepad++ does not lock files and is a great editor.

link|improve this answer
feedback

Vim does not lock files and is a great editor.
(yep, copy paste from above :)

link|improve this answer
And it runs nicely on Windows. Modern versions of gvim also do a fairly good job of working with a more Windows-like UI. You can mix and match traditional vi-isms and OS-aware cut and paste. – ConcernedOfTunbridgeWells Aug 11 '09 at 13:15
1  
Note that for reading logs, moreover, Vim will notify you of a change and propose you to load the updated file. – Gnoupi Aug 11 '09 at 15:11
1  
Notepad++ is also aware of external changes and prompts for reload. – Michael Todd Aug 11 '09 at 15:41
feedback

emacs does not lock files and is a great editor.
(yep, copy paste from above :)

If you are asking yourself Is there an editor that does xxxx you can be 99% sure that the answer is emacs, vi or both.

link|improve this answer
Is there an editor that does... the dishes? maybe the laundry too? ;-P – heavyd Aug 11 '09 at 19:04
I'm sure there's an emacs command for that – Herms Aug 11 '09 at 19:13
feedback

Tail does not lock files, and it's practically designed for watching changing text files. Perfect for logs.

link|improve this answer
inotail on linux is my favourite, it doesn't repeatedly scan the file looking for changes, it gets the kernel to tell it when the file is changed. However, this chap doesn't say he's running linux, so if he's on windows then "baretail" (baremetalsoft.com/baretail) is a pretty good equivalent. – GodEater Aug 11 '09 at 12:21
feedback

Why not just make a short script that will make a copy of the log file and then open it in your favorite text editor? This is an easy way to not be bothered with the worry of a file being locked. The bonus is you will never hang up another build again.

link|improve this answer
feedback

TextPad does not lock files and is a great editor.
(also copypaste'd, but it really is another good option)

link|improve this answer
feedback

Zeus - It will not lock and of the files it has open.

link|improve this answer
feedback

You just wanted to know if any particular text editor doesn't lock the file, not whether it's any good, so for Windows I give you....

Notepad

;-)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.