From 76e8e899258151ee7c87fce05996ae533454c2fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 25 Jul 2021 14:55:56 +0200 Subject: [PATCH] Add support for FILE_APPEND. --- Common/File/FileUtil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index 5468386096..14ffec9aa4 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -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; }