[Geany-devel] Prevent un-needed save as

Enrico Tröger enrico.troeger at xxxxx
Sun May 16 09:04:58 UTC 2010


On Sun, 16 May 2010 13:07:18 +1000, Lex wrote:

Heya,

> This came up on thread "[Geany-devel] Safe file saving - permissions
> issue" but isn't actually a problem with the filesystem, its just
> exposed by filesystem problems.

Thanks for breaking the thread.


> When a file goes missing and the user does not choose to save or
> close it, if it is reloaded after the file reappears, Geany still
> asks for a save as when it only needs to save.
> 
> The save as dialog is a problem for users on slow network filesystems
> as it queries all the files in the directory (if the directories are

No, slow network filesystems are a problem for the Save As dialog :).
Sorry, if I'm trying to open a huge directory over a slow network
connection, I can't blame the software which is trying to do perform
the task I requested. What I mean is, if the connection is slow, the
connection is slow. That's the problem.
Either don't use network filesystems or fix the connection. Of course,
this isn't as easy as it is said but still true, IMO.


> so large they should have been broken up :).  Of course users on slow
> network connections are also the most likely to have files go missing.
> 
> Attached patch (against r4917) re-sets the real_path of the file on
> reloads, has been running for me all day with no issues but I only
> have local filesystems @Jon can you test?

(from the other thread:)
> This seems to be because when a document disappears the real path is
> cleared but when it is reloaded the real path is not set again.  I'm
> not sure about side effects so I am asking Enrico or Nick, in
> document_open_file_full can the setptr( doc->real_path  be moved
> outside the if (! reload ) safely?

I think we did it within the if (! reload) for performance reasons,
getting the realpath is probably a bit expensive (I didn't measured
it). But if it solves your issues, it's maybe worth running it
unconditionally.


I think we can apply it except Nick sees any dangers (he usually
knows the stuff better than me :D).

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100516/fc1b4813/attachment.pgp>


More information about the Devel mailing list