Am 19.11.2013 00:14, schrieb Lex Trotman:
[...]


    >> 1. Project and user session file formats should match to allow the
    >> same code to store both.  The fact that the storing the current
    >> project in the project session file is not needed doesn't matter.

    It looks like a good idea, I agree, but we need to keep on allowing to
    save user-wide settings when a project is open.  I mean, we shouldn't
    save all settings changes to the project settings just because one is
    open, the user might want to change a general setting.

    I think this was discussed one day already, and I think it should be a
    separate thread.


I said **session** file format, not the config files, as you say ATM the only change to config should be to remove the session info. All further changes are indeed another topic.

[...]

    >
    > Old Geany couldn't read it since it's a directory, and I don't think
    > you can possibly overwrite a directory with a file, even
    > accidentally. You'd need to delete the directory first.

    I agree, I don't think this should be an issue.  Older Geany would not
    be able to load the project, but that should be all.  And if the
    config
    part starts with the same format as old $project.geany, a user could
    workaround that by loading $project.geany/project.conf manually.


I'm happy for it to be the same so long as someone can assure me that geany saving a file can't overwrite a directory on the most common file system arrangements which includes windows and includes windows file systems on a NAS mounted via Samba (a sadly increasing situation with cheep NAS boxes).

Note that config saving will use g_file_set_contents() if the option is set, which writes to a temp file, and renames it over the old file. I agree that on Linux it can't rename a file over a directory, but on what it thinks is a windows file system it deletes the old file first and then renames the temp to it. Are we sure that won't allow it to overwrite directories?




I would consider it a bug in g_file_set_contents() if doesn't check permissions and type of the original object (file) before doing the temp&rename approach. Because that would mean different semantics compared to direct save.

FWIW, let's not overcomplicate this. We can easily chose another naming scheme for the directory.

Best regards.
_______________________________________________
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel

Reply via email to