(method: string, flag: FileSystem.OpenFlag)
| 248 | |
| 249 | // Reject unsupported platforms: libuv silently ignores unknown flags on Windows. |
| 250 | const noFollowFlags = (method: string, flag: FileSystem.OpenFlag) => |
| 251 | Effect.suspend(() => { |
| 252 | const { O_NOFOLLOW } = NFS.constants |
| 253 | if (process.platform === "win32" || typeof O_NOFOLLOW !== "number" || O_NOFOLLOW === 0) { |
| 254 | return Effect.fail(Error.badArgument({ |
| 255 | module: "FileSystem", |
| 256 | method, |
| 257 | description: "noFollow is not supported on this platform" |
| 258 | })) |
| 259 | } |
| 260 | return Effect.succeed(openFlagBits(flag) | O_NOFOLLOW) |
| 261 | }) |
| 262 | |
| 263 | const openFactory = (method: string): FileSystem.FileSystem["open"] => { |
| 264 | const nodeOpen = effectify( |
no test coverage detected