Hyperlinkv0.8.0-beta.28

FileSystem

FileSystem.PiBconsteffect/FileSystem.ts:648
(n: number): Size

Creates a Size representing pebibytes (1024⁵ bytes).

Details

Converts a number of pebibytes to the equivalent size in bytes. Uses binary pebibytes (1,125,899,906,842,624 bytes) rather than decimal petabytes. This function uses BigInt arithmetic to handle the very large numbers involved.

Example (Creating pebibyte sizes)

import { Console, Effect, FileSystem } from "effect"

const program = Effect.gen(function*() {
  const fs = yield* FileSystem.FileSystem

  // For extremely large data processing scenarios
  const massiveDataset = FileSystem.PiB(2) // 2 PiB

  // This would typically be used in enterprise/cloud scenarios
  yield* Console.log(`Processing ${massiveDataset} bytes of data`)

  // Such large files would require specialized streaming
  const stream = fs.stream("massive-dataset.bin", {
    chunkSize: FileSystem.GiB(1), // 1 GiB chunks
    offset: FileSystem.TiB(100) // Start from 100 TiB offset
  })
})
sizes
export const PiB = (n: number): Size => Size(BigInt(n) * bigintPiB)
Referenced by 1 symbols