Add support for FILE_APPEND.

This commit is contained in:
Henrik Rydgård committed 2021-07-25 15:42:12 +02:00
1 parent e9f19e133b
commit 76e8e89925
1 file changed
+6
+6
View File
@@ -223,6 +223,12 @@ int OpenFD(const Path &path, OpenFlag flags) {
if (descriptor < 0) {
ERROR_LOG(COMMON, "Android_OpenContentUriFd failed: '%s'", path.c_str());
}
if (flags & OPEN_APPEND) {
// Simply seek to the end of the file to simulate append mode.
lseek(descriptor, 0, SEEK_END);
}
return descriptor;
}