Skip to content

Commit 834518b

Browse files
author
Preben Ludviksen
committed
Fixes to README.
1 parent 9587126 commit 834518b

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,50 @@ and have similar behaviour on Android. Example usage:
6666
FileSystem.writeToFile('my-file.txt', 'My content', FileSystem.storage.important);
6767
```
6868

69-
Files need to be read from the same storage class they're saved to, and two files can have the same name
70-
if they're located in different storages. The options are:
69+
Files need to be read from the same storage class they're saved to, and two files can have the same
70+
name if they're located in different storages. The options are:
7171

7272
#### storage.backedUp
7373

74-
The default. Files stored in this location will automatically be backed up by iCloud on iOS and [Auto Backup for Apps](https://developer.android.com/guide/topics/data/autobackup.html) on Android. This is generally for user-generated content that cannot be re-generated / re-downloaded.
74+
The default. Files stored in this location will automatically be backed up by iCloud on iOS and
75+
[Auto Backup for Apps](https://developer.android.com/guide/topics/data/autobackup.html) on Android
76+
devices running Marshmallow or newer (6.0+). This is where you'd want to put user generated content.
7577

76-
Corresponds to `<Application_Home>/Documents` on iOS and [Context.getFilesDir()](https://developer.android.com/reference/android/content/Context.html#getFilesDir()) on Android.
78+
Corresponds to `<Application_Home>/Documents` on iOS and
79+
[Context.getFilesDir()](https://developer.android.com/reference/android/content/Context.html#getFilesDir())
80+
on Android.
7781

7882
#### storage.important
7983

80-
This is for files that are possible to re-generate / re-download, but are still important to keep around. F.ex. offline maps.
84+
This is for files that are possible to re-generate / re-download, but are still important to keep
85+
around during low storage situations. F.ex. offline maps. The system will almost always keep these
86+
files around.
8187

82-
Corresponds to `<Application_Home>/Library/Caches` with "do not backup" flag on iOS and [Context.getNoBackupFilesDir()](https://developer.android.com/reference/android/content/Context.html#getNoBackupFilesDir()) on Android.
88+
Corresponds to `<Application_Home>/Library/Caches` with "do not backup" flag on iOS, and a
89+
subdirectory of
90+
[Context.getFilesDir()](https://developer.android.com/reference/android/content/Context.html#getFilesDir())
91+
on Android.
8392

8493
#### storage.auxiliary
8594

86-
This storage class is for files that can be re-created, and are not crucial to the proper functioning of your app.
95+
This storage class is for files that can be re-created, and that the app can live without. On
96+
Android this storage behaves the same as `storage.important`, but on iOS the system can delete
97+
these files in low storage situations. To play it safe, you should gracefully handle the case where
98+
they are gone, by checking their existence.
99+
100+
Corresponds to `<Application_Home>/Library/Caches` on iOS, and a subdirectory of
101+
[Context.getFilesDir()](https://developer.android.com/reference/android/content/Context.html#getFilesDir())
102+
explicitly excluded from backup on Android.
87103

88-
Corresponds to `<Application_Home>/Library/Caches` on iOS and [Context.getExternalCacheDir()](https://developer.android.com/reference/android/content/Context.html#getExternalCacheDir()) on Android.
89104

90105
#### storage.temporary
91106

92-
Location for temporary caches and data. You should still clean up / delete the files when they are no longer in use.
107+
Location for temporary caches and data. The system can get rid of these at any time, but you are
108+
still required to delete them manually to free up space when they are no longer in use.
93109

94-
Corresponds to `<Application_Home>/tmp` on iOS and [Context.getCacheDir()](https://developer.android.com/reference/android/content/Context.html#getCacheDir()) on Android.
110+
Corresponds to `<Application_Home>/tmp` on iOS and
111+
[Context.getCacheDir()](https://developer.android.com/reference/android/content/Context.html#getCacheDir())
112+
on Android.
95113

96114
## Questions?
97115

0 commit comments

Comments
 (0)