-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cache: OS-specific cache directories #1287
Conversation
Windows, and to a lesser extent OS X, don't conform to XDG and have their own preferred locations for caches. On Windows, use %LOCALAPPDATA%/restic (i.e., ~/AppData/Local/restic). I can't find authoritative documentation from Microsoft recommending specifically which of %APPDATA%, %LOCALAPPDATA%, and %TEMP% should be used for caches, but %LOCALAPPDATA% is where browsers store their caches, so it seems like a good fit. On OS X, use ~/Library/Caches/restic, which is recommended by the Apple documentation. They do suggest using the application "bundle identifier" as the base folder name, but restic doesn't have one, so I just used "restic".
Codecov Report
@@ Coverage Diff @@
## master #1287 +/- ##
=========================================
- Coverage 52.25% 46.6% -5.65%
=========================================
Files 134 134
Lines 13016 13039 +23
=========================================
- Hits 6801 6077 -724
- Misses 5384 6186 +802
+ Partials 831 776 -55
Continue to review full report at Codecov.
|
Just small note.
The only thing I'm wondering is that |
I can report that this works swimmingly on my Windows machine. @dionorgua good to know thanks. Setting that registry key would be clever, but I think that is outside the scope of this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
cache: OS-specific cache directories
Confirmed working on macOS 10.12.6. |
Thank you very much for the confirmation. This change is better done sooner rather than later, while the number of people affected (in terms of "have an unused cache lying around") is small. Thanks everyone! |
PR restic#1287 changed the default cache location on darwin and windows. Update the changelog and manual to reflect the new behavior. Since the cache hasn't been included in an official release yet, I've just changed the main cache changelog entry. Fixes restic#1309
Note: I haven't had a chance to test this on Windows yet, and I don't have an OS X machine.
Windows, and to a lesser extent OS X, don't conform to XDG and have
their own preferred locations for caches.
On Windows, use %LOCALAPPDATA%/restic (i.e., ~/AppData/Local/restic). I
can't find authoritative documentation from Microsoft recommending
specifically which of %APPDATA%, %LOCALAPPDATA%, and %TEMP% should be
used for caches, but %LOCALAPPDATA% is where browsers store their
caches, so it seems like a good fit.
On OS X, use ~/Library/Caches/restic, which is recommended by the Apple
documentation. They do suggest using the application "bundle identifier"
as the base folder name, but restic doesn't have one, so I just used
"restic".