CsvFile.reader

CsvResult!(CsvReader!(const(char)[])) reader()

Create a CsvReader 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 CsvReader 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 CsvReader over an in-memory buffer 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 ddnMaxMmapSize32.
  • If memory mapping fails due to platform policy or permissions, the reader also falls back to the buffered path automatically.

    Returns

    CsvResult!(CsvReader!(const(char)[])) — a reader on success, or invalidDialect when called for unsupported modes. Open failures are surfaced as ioFailure.