CsvFile.reader

Create a CsvFileReader over this file's contents.

Behavior:

  • When memoryMapped == true and mode == CsvOpenMode.READ, the file is memory-mapped via std.mmfile.MmFile and a zero-copy CsvFileReader over the mapped bytes is returned.
  • When memoryMapped == false and mode == CsvOpenMode.READ, the file is read using a large buffered reader (see BufferManager from T04) and a streaming CsvFileReader is returned. This provides behavior parity with the memory-mapped path while avoiding mapping.

Cross-platform notes:

  • On 32‑bit builds the available virtual address space is limited. For large files the reader may automatically fall back to the buffered path even when memoryMapped == true. The decision uses ddnCanMemoryMapSize(fileSize), with a conservative cap DDN_MAX_MAP_SIZE32.
  • If memory mapping fails due to platform policy or permissions, the reader also falls back to the buffered path automatically.

    Returns

    CsvResult!CsvFileReader — a reader on success, or INVALID_DIALECT/INVALID_MODE for invalid configuration or mode. Open failures are surfaced as IO_FAILURE.