You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -996,9 +996,7 @@ file should be opened. It can be a combination of the following flags:
996
996
|`FS_TRUNCATE`| Only valid when used with `FS_WRITE`. If the file already exists, it will be truncated to zero length when opened. If the file does not exist, it will be created. Not compatible with `FS_APPEND`. |
997
997
|`FS_APPEND`| Only valid when used with `FS_WRITE`. All writes will occur at the end of the file, regardless of the current cursor position. If the file does not exist, it will be created. Not compatible with `FS_TRUNCATE`. |
998
998
|`FS_EXCLUSIVE`| Only valid when used with `FS_WRITE`. The file will be created, but if it already exists, the open will fail with FS_ALREADY_EXISTS. |
999
-
| `FS_TRANSPARENT` | This is the default behavior. When used, files inside archives can be opened transparently. For example, "somefolder/archive.zip/file.txt" can be opened with "somefolder/file.txt" (the "archive.zip" part need not be specified). This assumes the `fs` object has been initialized with support for the relevant archive types.<br><br>Transparent mode is the slowest mode since it requires searching through the file system for archives, and then open those archives, and then searching through the archive for the file. If this is prohibitive, consider using `FS_OPAQUE` (fastest) or `FS_VERBOSE` modes instead.<br><br>Furthermore, you can consider having a rule in your application that instead of opening files inside archives from a transparent path, that you instead mount the archive, and then open all files with `FS_OPAQUE`, but with a virtual path that points to the archive. For example: <pre><code>
fs_file_open(pFS, "assets/file.txt", FS_READ \| FS_OPAQUE, &pFile);</code></pre><br>Here the archive is mounted to the virtual path "assets". Because the path "assets/file.txt" is prefixed with "assets", the file system knows to look inside the mounted archive without having to search for it. |
999
+
| `FS_TRANSPARENT` | This is the default behavior. When used, files inside archives can be opened transparently. For example, "somefolder/archive.zip/file.txt" can be opened with "somefolder/file.txt" (the "archive.zip" part need not be specified). This assumes the `fs` object has been initialized with support for the relevant archive types.<br><br>Transparent mode is the slowest mode since it requires searching through the file system for archives, and then open those archives, and then searching through the archive for the file. If this is prohibitive, consider using `FS_OPAQUE` (fastest) or `FS_VERBOSE` modes instead.<br><br>Furthermore, you can consider having a rule in your application that instead of opening files inside archives from a transparent path, that you instead mount the archive, and then open all files with `FS_OPAQUE`, but with a virtual path that points to the archive. For example: <br> <br> fs_mount(pFS, "somefolder/archive.zip", "assets", FS_READ);<br> fs_file_open(pFS, "assets/file.txt", FS_READ \| FS_OPAQUE, &pFile);<br><br>Here the archive is mounted to the virtual path "assets". Because the path "assets/file.txt" is prefixed with "assets", the file system knows to look inside the mounted archive without having to search for it. |
1002
1000
|`FS_OPAQUE`| When used, archives will be treated as opaque, meaning attempting to open a file from an unmounted archive will fail. For example, "somefolder/archive.zip/file.txt" will fail because it is inside an archive. This is the fastest mode, but you will not be able to open files from inside archives unless it is sourced from a mount. |
1003
1001
|`FS_VERBOSE`| When used, files inside archives can be opened, but the name of the archive must be specified explicitly in the path, such as "somefolder/archive.zip/file.txt". This is faster than `FS_TRANSPARENT` mode since it does not require searching for archives. |
1004
1002
|`FS_NO_CREATE_DIRS`| When opening a file in write mode, the default behavior is to create the directory structure automatically if required. When this options is used, directories will *not* be created automatically. If the necessary parent directories do not exist, the open will fail with FS_DOES_NOT_EXIST. |
0 commit comments