Merge pull request #2175 from inexcode/fix/tmp-subdirectory
fix: Create a subdirectory in the tmp directory
This commit is contained in:
commit
4b2611e892
1 changed files with 6 additions and 1 deletions
|
|
@ -65,7 +65,12 @@ Future<MatrixSdkDatabase> _constructDatabase(String clientName) async {
|
||||||
|
|
||||||
Directory? fileStorageLocation;
|
Directory? fileStorageLocation;
|
||||||
try {
|
try {
|
||||||
fileStorageLocation = await getTemporaryDirectory();
|
final tmpDir = await getTemporaryDirectory();
|
||||||
|
final appTmpDir = Directory(join(tmpDir.path, clientName));
|
||||||
|
if (!await appTmpDir.exists()) {
|
||||||
|
await appTmpDir.create(recursive: true);
|
||||||
|
}
|
||||||
|
fileStorageLocation = appTmpDir;
|
||||||
} on MissingPlatformDirectoryException catch (_) {
|
} on MissingPlatformDirectoryException catch (_) {
|
||||||
Logs().w(
|
Logs().w(
|
||||||
'No temporary directory for file cache available on this platform.',
|
'No temporary directory for file cache available on this platform.',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue