+ /* Disable multi-threaded operation. */
+ fuse_argv[fuse_argc++] = "-s";
+
+ /* Enable FUSE debug mode (don't fork) if requested by the user. */
+ if (mount_flags & WIMLIB_MOUNT_FLAG_DEBUG)
+ fuse_argv[fuse_argc++] = "-d";
+
+ /*
+ * Build the FUSE mount options:
+ *
+ * use_ino
+ * FUSE will use the inode numbers we provide. We want this,
+ * because we have inodes and will number them ourselves.
+ *
+ * subtype=wimfs
+ * Name for our filesystem (main type is "fuse").
+ *
+ * hard_remove
+ * If an open file is unlinked, unlink it for real rather than
+ * renaming it to a hidden file. Our code supports this; an
+ * unlinked inode is retained until all its file descriptors have
+ * been closed.
+ *
+ * default_permissions
+ * FUSE will perform permission checking. Useful when
+ * WIMLIB_MOUNT_FLAG_UNIX_DATA is provided and the WIM image
+ * contains the UNIX permissions for each file.
+ *
+ * kernel_cache
+ * Cache the contents of files. This will speed up repeated access
+ * to files on a mounted WIM image, since they won't need to be
+ * decompressed repeatedly. This option is valid because data in
+ * the WIM image should never be changed externally. (Although, if
+ * someone really wanted to they could modify the WIM file or mess
+ * with the staging directory; but then they're asking for
+ * trouble.)
+ *
+ * entry_timeout=1000000000
+ * Cache positive name lookups indefinitely, since names can only
+ * be added, removed, or modified through the mounted filesystem
+ * itself.
+ *
+ * negative_timeout=1000000000
+ * Cache negative name lookups indefinitely, since names can only
+ * be added, removed, or modified through the mounted filesystem
+ * itself.
+ *
+ * attr_timeout=0
+ * Don't cache file/directory attributes. This is needed as a
+ * workaround for the fact that when caching attributes, the high
+ * level interface to libfuse considers a file which has several
+ * hard-linked names as several different files. (Otherwise, we
+ * could cache our file/directory attributes indefinitely, since
+ * they can only be changed through the mounted filesystem itself.)
+ */
+ char optstring[256] =
+ "use_ino"
+ ",subtype=wimfs"
+ ",hard_remove"
+ ",default_permissions"
+ ",kernel_cache"
+ ",entry_timeout=1000000000"
+ ",negative_timeout=1000000000"
+ ",attr_timeout=0"
+ ;
+ fuse_argv[fuse_argc++] = "-o";
+ fuse_argv[fuse_argc++] = optstring;
+ if (!(mount_flags & WIMLIB_MOUNT_FLAG_READWRITE))
+ strcat(optstring, ",ro");
+ if (mount_flags & WIMLIB_MOUNT_FLAG_ALLOW_OTHER)
+ strcat(optstring, ",allow_other");
+ fuse_argv[fuse_argc] = NULL;
+
+ /* Mount our filesystem. */
+ ret = fuse_main(fuse_argc, fuse_argv, &wimfs_operations, &ctx);
+
+ /* Cleanup and return. */
+ if (ret)