LocalPath: move files from application storage to media storage
Your PR should:
- all description should be in the commit messages (no text in the pr)
- your pr should be rebased on the current HEAD
- one commit per atomic feature (every commit should build)
- no fixup commits
- pass all the compile and CI targets
For coding, style guide, architecture information please see our development guide: https://xcsoar.readthedocs.io/en/latest/index.html
Not using std::filesystem was an explicit decision I made for XCSoar. Like iostreams, it's a badly designed API and the implementation is bloated and slow. Look at how much your executable size grows with this piece of code. Better stay away from std::filesystem.
If you want a small and fast implementation for copying a directory recursively, look at https://github.com/CM4all/libcommon/blob/master/src/io/RecursiveCopy.hxx (Linux-only though, but that's all you need here anyway)
There's alternative option to not doing this complicated migration for user but instead let user do the migration themself.
(This was one of the blocker why I can't update the XCSoar JET release since last year as it'll break the user expectation)
I simply did:
- keep using
getExternalFilesDirs()for anyone that already using it (by simple checking existent ofxcsoar.log) - user have the migration path by just uninstall and re-install and they need to do backup and restore themself
- avoid adding complexity in the codebase
If you like the idea, I can put up a PR from https://github.com/zinuzoid/XCSoar/commit/110e8e0d3381f3f16c0804d9f32b06543b62d25b
@zinuzoid i like your approach better. This has a lot less dependencies and processes that can fail. I couldn't find your commit in git, just on the webpage.
@zinuzoid i like your approach better. This has a lot less dependencies and processes that can fail. I couldn't find your commit in git, just on the webpage.
Not sure if you still need it but this https://github.com/zinuzoid/XCSoar/commit/e7d31e6e32951dcab88d21d57b5db2c9a03b90ad is on the master, you should be able to find it.
Unless you're already sorted, I would be happy to create pull request. Otherwise it's fine for me.