On Sat, 22 May 2010 21:15:59 +1000 Lex Trotman elextr@gmail.com wrote:
Speaking of NFS (I read the patch) O_EXCL is problematic [...]
Thats correct, note I used g_open which seems to say that it works under windows as well. [...] the only potential problem is that it can be disabled by registery settings, according to Samba documentation anyway.
If the lock file is not successfully unlinked by Geany for some reason, for example a broken NFS connection, it'll have to be deleted manually. Well, that shoudn't be a big problem, but if there's some way to avoid it...
Not that I'm aware of, anybody who knows any other way that works on *ix and Windows is welcome to suggest it.
Both on *ix and Win~1, hmmm...
It just occured to me, what if we write the configuration into geany-some-unique-id.conf and then g_rename() it? Rename is an atomic operation; on NFS, "you can not assume that if the operation failed the file was not renamed" - well, we can emit a geany_debug() message for this. Even if Win~1 g_rename() is somehow broken, a MoveFileEx (..., MOVEFILE_REPLACE_EXISTING) will do.
We know that both entries are files, they are on the same filesystem, and the destination file is writable - that eliminates almost any possible rename error.