Truncate existing file when writing to removable drive

This commit is contained in:
cketti
2022-03-29 01:27:01 +02:00
parent 88c8bd32a5
commit 50f9718037

View File

@@ -39,6 +39,6 @@ class AndroidRemovableDrivePlugin extends RemovableDrivePlugin {
OutputStream openOutputStream(TransportProperties p) throws IOException { OutputStream openOutputStream(TransportProperties p) throws IOException {
String uri = p.get(PROP_URI); String uri = p.get(PROP_URI);
if (isNullOrEmpty(uri)) throw new IllegalArgumentException(); if (isNullOrEmpty(uri)) throw new IllegalArgumentException();
return app.getContentResolver().openOutputStream(Uri.parse(uri)); return app.getContentResolver().openOutputStream(Uri.parse(uri), "wt");
} }
} }