Skip to content

Commit

Permalink
Truncate DocumentFile before writing to it
Browse files Browse the repository at this point in the history
Before 43d88fd, this was not needed, because the file was always deleted
and re-created first.

This should resolve issues #385 and #395.
  • Loading branch information
amberin committed Nov 7, 2024
1 parent ee16997 commit a056bc6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public VersionedRook storeBook(File file, String repoRelativePath) throws IOExce
}
}

try (OutputStream out = context.getContentResolver().openOutputStream(destinationFile.getUri())) {
try (OutputStream out = context.getContentResolver().openOutputStream(destinationFile.getUri(), "wt")) {
MiscUtils.writeFileToStream(file, out);
}

Expand Down

0 comments on commit a056bc6

Please sign in to comment.