Skip to content

Commit 1b37304

Browse files
committed
Document file system path and directory entry limits
1 parent 2412cee commit 1b37304

File tree

1 file changed

+15
-0
lines changed
  • src/content/docs/workers/runtime-apis/nodejs

1 file changed

+15
-0
lines changed

src/content/docs/workers/runtime-apis/nodejs/fs.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,21 @@ Since all temporary files are held in memory, the total size of all temporary
7676
files created count towards your Worker’s memory limit. If you exceed this
7777
limit, the Worker instance will be terminated and restarted.
7878

79+
The file system implementation has the following limits:
80+
81+
* The maximum total length of a file path is 4096 characters, including path
82+
separators. Because paths are handled as file URLs internally, the limit
83+
accounts for percent-encoding of special characters, decoding characters
84+
that do not need encoding before the limit is checked. For example, the
85+
path `/tmp/abcde%66/ghi%zz' is 18 characters long because the `%66` does
86+
not need to be percent-encoded and is therefore counted as one character,
87+
while the `%zz` is an invalid percent-encoding that is counted as 3 characters.
88+
* The maximum number of path segments is 48. For example, the path `/a/b/c` is
89+
3 segments.
90+
* The maxumum number of entries in a directory is 1024. This includes files,
91+
directories, and symlinks.
92+
* The maximum size of an individual file is 128 MB total.
93+
7994
:::
8095

8196
The full `node:fs` API is documented in the [Node.js documentation for `node:fs`](https://nodejs.org/api/fs.html).

0 commit comments

Comments
 (0)