Add utility to prepare files in a similar way to directories
Bug: 28785119
Bug: 28625993
Change-Id: I505eb4deca0a89f64fe4505dd6729fe6a48bc1aa
diff --git a/include/cutils/fs.h b/include/cutils/fs.h
index be9e819..a34ce86 100644
--- a/include/cutils/fs.h
+++ b/include/cutils/fs.h
@@ -52,6 +52,13 @@
extern int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid);
/*
+ * Ensure that file exists with given mode and owners. If it exists
+ * with different owners, they are not fixed and -1 is returned.
+ */
+extern int fs_prepare_file_strict(const char* path, mode_t mode, uid_t uid, gid_t gid);
+
+
+/*
* Read single plaintext integer from given file, correctly handling files
* partially written with fs_write_atomic_int().
*/