+ exfat_debug("[%s] %s flags %#x%s%s%s%s%s", __func__, path, fi->flags,
+ fi->flags & O_RDONLY ? " O_RDONLY" : "",
+ fi->flags & O_WRONLY ? " O_WRONLY" : "",
+ fi->flags & O_RDWR ? " O_RDWR" : "",
+ fi->flags & O_APPEND ? " O_APPEND" : "",
+ fi->flags & O_TRUNC ? " O_TRUNC" : "");
+
+ rc = exfat_lookup(&ef, &node, path);
+ if (rc != 0)
+ return rc;
+ /* FUSE 2.x will call fuse_exfat_truncate() explicitly */
+#if FUSE_USE_VERSION >= 30
+ if (fi->flags & O_TRUNC)
+ {
+ rc = exfat_truncate(&ef, node, 0, true);
+ if (rc != 0)
+ {
+ exfat_put_node(&ef, node);
+ return rc;
+ }
+ }
+#endif
+ set_node(fi, node);
+ return 0;
+}
+
+static int fuse_exfat_create(const char* path, UNUSED mode_t mode,
+ struct fuse_file_info* fi)
+{
+ struct exfat_node* node;
+ int rc;
+
+ exfat_debug("[%s] %s 0%ho", __func__, path, mode);