(
path: string,
options?: {
readonly bytesToRead?: FileSystem.SizeInput | undefined
readonly chunkSize?: FileSystem.SizeInput | undefined
readonly offset?: FileSystem.SizeInput | undefined
readonly contentType?: string | undefined
}
)
| 509 | * @since 4.0.0 |
| 510 | */ |
| 511 | export const file = ( |
| 512 | path: string, |
| 513 | options?: { |
| 514 | readonly bytesToRead?: FileSystem.SizeInput | undefined |
| 515 | readonly chunkSize?: FileSystem.SizeInput | undefined |
| 516 | readonly offset?: FileSystem.SizeInput | undefined |
| 517 | readonly contentType?: string | undefined |
| 518 | } |
| 519 | ): Effect.Effect<Stream, PlatformError.PlatformError, FileSystem.FileSystem> => |
| 520 | Effect.flatMap( |
| 521 | FileSystem.FileSystem, |
| 522 | (fs) => |
| 523 | Effect.map(fs.stat(path), (info) => |
| 524 | stream( |
| 525 | fs.stream(path, options), |
| 526 | options?.contentType, |
| 527 | fileContentLength(info.size, options) |
| 528 | )) |
| 529 | ) |
| 530 | |
| 531 | /** |
| 532 | * Creates a streaming HTTP body for a file path using already-known file information. |
nothing calls this directly
no test coverage detected