Try to create the autosave directory if that does not exists

Bug #490338 reported by Aurium
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
John Smith

Bug Description

I try to use the a sub-directory of my home as the Inkscape autosave location to don't mess with my files.

I only define the path "/home/aurium/ink-bak" and wait to see it works, but it can't create the directory automatically, and trow the warning to the terminal: "Cannot open autosave directory"

The automatic creation of the autosave directory is important to help the user in some ways:
  - fast deletion of autosaves deleting the dir without needing to re-create the dir.
  - protect misunderstanding when the user create a dir with a name and configure other name.
  - help user desktop migration, when only important things are bakuped, like specific configuration.
  - help the Inkscape configuration sharing.

When Inkscape really can't to create the dir, it must say "Cannot create the directory <dir path> for autosave"
(the <dir path> is really important to find personal errors)

Tags: autosave ui
su_v (suv-lp)
tags: added: autosave ui
jazzynico (jazzynico)
Changed in inkscape:
importance: Undecided → Wishlist
Changed in inkscape:
assignee: nobody → Jon A. Cruz (jon-joncruz)
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

related reports:
Bug #570695 “show default|fallback autosave path”
Bug #635992 “autosave on by default”

Revision history for this message
John Smith (john-smithi) wrote :

Patch that attempts to create the autosave directory, if it doesn't exist.
Tested on Ubuntu 12.04 and Windows 7.

Changed in inkscape:
assignee: Jon A. Cruz (jon-joncruz) → John Smith (john-smithi)
status: Confirmed → In Progress
Revision history for this message
su_v (suv-lp) wrote :

> Patch that attempts to create the autosave directory, if it doesn't exist.

Is this correct?
- does not accept '~' or e.g. '$HOME'
- a relative path is resolved relative to '$HOME' (or is it to the directory Inkscape was launched from?)

Maybe the tooltip could contain minimal information about how what is accepted as input (Linux/OS X, Windows)?

Revision history for this message
John Smith (john-smithi) wrote :

Relative paths dont seem to work well - a single name "tmp1" works, but "tmp2/tmp3" doesnt seem to work on Ubuntu.
Relative paths are saved relative to the "current directory" [1] - usually the directory the application was launched from.
Variables such as '~', '$HOME' seem to be not "interpreted" to their absolute path equivalents and are used as-is in the function g_mkdir [2] (A wrapper for the POSIX mkdir() function)

How about the tooltip recommend saving absolute paths ?

[1] http://www.gtk.org/api/2.6/glib/glib-Miscellaneous-Utility-Functions.html#g-get-current-dir
[2] http://www.gtk.org/api/2.6/glib/glib-File-Utilities.html#g-mkdir

Revision history for this message
John Smith (john-smithi) wrote :

Committed as r11759.

Changed in inkscape:
status: In Progress → Fix Committed
Kris (kris-degussem)
Changed in inkscape:
milestone: none → 0.49
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.