]> git.mjollnir.org Git - cil.git/commit
Support editors that use "atomic write"
authorPedro Melo <melo@simplicidade.org>
Fri, 6 Mar 2009 06:45:29 +0000 (06:45 +0000)
committerAndrew Chilton <andychilton@gmail.com>
Tue, 4 Oct 2011 04:22:13 +0000 (17:22 +1300)
commit9cae9596f173dff8ff9534cce095374fe47f5196
tree6e394cb56e3637606e8ca7da5e00a2945a22fece
parent86e3aaf385a51161d27117a3d16f32b8738cd57f
Support editors that use "atomic write"

Some editors (like TextMate and at least my configuration of Vim) save
the file using an "atomic write".

They write the file to a new, temporary filename, and then rename the new
filename to the old filename. This assures that the file is never
"half-written" or corrupted in case of a crash.

The solicit() code didn't support this. By using seek() to rewind the
file pointer he was assuming that the editor was reusing the same inode.

Signed-off-by: Pedro Melo <melo@simplicidade.org>
lib/CIL/Utils.pm