---
title: "Two File Handles Can Share One AI Input Read Cursor"
description: "Leviathan Systems — Technical content Published 2026-10-21; updated 2026-10-21."
canonical: "https://www.leviathansystems.co/articles/ai-file-readers-shared-open-description-cursor"
last-updated: "2026-10-21"
---

# Two File Handles Can Share One AI Input Read Cursor

Leviathan Systems — Technical content
Published 2026-10-21; updated 2026-10-21.

Two Linux file descriptors share a read cursor when they refer to the same open file description, as with successful descriptor duplication. Separate opens of the same stable file create separate descriptions with independent offsets. A loader handoff should identify whether it supplies one continuing traversal or independently positioned readers. Two handle names and matching file contents leave that relationship unresolved.

## Locate the cursor between the descriptor and the file

A loader can receive two handles without receiving two independent traversal positions. Here, handle means a Linux file descriptor: the process-local reference used for a file operation. An open file description, abbreviated OFD, holds the current byte offset and file status flags. The underlying file supplies the contents.

Linux man-pages 6.19 distinguishes two relationships. Successful descriptor duplication gives another descriptor for the same OFD. Separate opens create separate OFDs, even when they reach the same file. Each fresh open starts its offset at the beginning.

The flag distinction is equally precise. Duplicated descriptors share file status flags through their OFD; file descriptor flags, including FD_CLOEXEC, are separate. Sharing an offset does not mean sharing every kind of flag.

Consequently, identifying the same file for both readers does not identify their cursor relationship. The missing fact is whether their descriptors reference one OFD or two.

References: [D1](https://man7.org/linux/man-pages/man2/dup.2.html), [O1](https://man7.org/linux/man-pages/man2/open.2.html)

## CURSOR62 holds the file and read schedule fixed

CURSOR62 is an original fictional comparison, not an observed loader run. One ordinary seekable local regular file contains exactly the six ASCII bytes ABCDEF, at byte offsets 0 through 5, with no trailing newline. Its contents and name stay unchanged. Both descriptors permit reading. There are no writes, seeks, other reads, errors or concurrent operations.

The schedule is three completed ordinary reads, in order: A, then B, then A again. Each requests two bytes and is stipulated to return exactly two bytes successfully. In the shared arrangement, A and its duplicate B reference one OFD whose offset starts at 0. In the independent arrangement, A and B come from separate opens of that same file, each with an offset of 0.

The read reference says a seekable-file read begins at the current offset and advances it by the bytes actually read. Successful reads can generally be shorter than requested; CURSOR62 expressly fixes all three returned lengths. The comparison concerns the descriptor-level read boundary. Library buffering and explicit-offset interfaces require their own account.

References: [D1](https://man7.org/linux/man-pages/man2/dup.2.html), [O1](https://man7.org/linux/man-pages/man2/open.2.html), [R1](https://man7.org/linux/man-pages/man2/read.2.html)

## Follow the same three reads through both arrangements

First, A reads. In the shared arrangement, A starts at offset 0, returns AB from positions 0 and 1, and advances the shared offset to 2. B therefore also reaches that offset. In the independent arrangement, A likewise returns AB and advances its own offset to 2, while B stays at 0.

Second, B reads. The shared arrangement starts B at the shared offset of 2, so it returns CD from positions 2 and 3 and leaves the shared offset at 4. The independent arrangement starts B at its own offset of 0, so it returns AB and advances B to 2. Independent A remains at 2.

Third, A reads again. With the shared OFD, A starts at 4, returns EF from positions 4 and 5, and leaves the shared offset at 6. With separate OFDs, A resumes at its own offset of 2, returns CD, and advances to 4. Independent B remains at 2.

The shared result sequence is therefore AB, CD, EF, with one final offset of 6. The independent sequence is AB, AB, CD, with final offsets A = 4 and B = 2. The file has supplied the same stable bytes throughout; the different cursor relationships explain the different returns.

References: [D1](https://man7.org/linux/man-pages/man2/dup.2.html), [O1](https://man7.org/linux/man-pages/man2/open.2.html), [R1](https://man7.org/linux/man-pages/man2/read.2.html)

## Six returned bytes can cover four distinct positions

Both arrangements return 2 + 2 + 2 = 6 bytes. That total counts deliveries, including any repeated positions. It does not describe the union of file positions reached.

The shared sequence covers positions 0 through 5 once each: six distinct positions. The independent sequence covers positions 0 and 1 twice and positions 2 and 3 once. It delivers six bytes while reaching only four distinct positions.

Positions 4 and 5 have not been reached in the independent arrangement's three supplied reads. Their bytes have not vanished: they remain EF in the unchanged file. Nor does returning AB through both readers establish duplicated application records. The example defines bytes and positions, with no record format or consumer behavior.

These two counts answer different questions. Six is the returned-byte total in either case. Six versus four is the distinct-position coverage of this particular schedule. Neither count by itself establishes a complete or failed model load.

## Match the supplied handles to the intended traversal

If A and B are each meant to begin their own traversal at the first input byte, the independent arrangement supplies that starting relationship. In CURSOR62, both readers' first returns are AB. A shared arrangement would instead give B CD after A's first read.

If the intended handoff is one traversal continuing across the stipulated A–B–A schedule, the shared arrangement supplies that relationship: each read resumes where the preceding one ended. Separate opens preserve each reader's own progress, so that schedule revisits the initial positions. This does not make either arrangement universally preferable; the required traversal determines which relationship fits.

Ask the appointed loader provider to identify the descriptors' OFD relationship, starting offsets and actual reading interface, then connect those facts to what each recipient is supposed to consume. The description should retain returned lengths rather than silently treating every request as full. A descriptor count or matching content identity cannot substitute for that explanation.

CURSOR62 establishes this serial relationship only. It supplies no concurrent assignment, fairness or record-partition guarantee, and makes no throughput, storage-capacity or model-quality claim.

## Keep file identity and completion accounting with their owners

The related Pathname Replacement and Open Readers article asks which file generation a retained reader references after a name changes. CURSOR62 keeps the file fixed and asks which traversal state two descriptors share.

The Hard-Link Names and File Identity article explains how different paths can name one mutable file. Such a naming relationship alone leaves the separate OFD question unanswered.

The io_uring Read Completion article uses explicit nonoverlapping offsets and accounts for positive returned bytes, EOF and errors. Its requested-range and completion-result analysis answers a different question from this example's current-offset traversal. Use those guides when the supplied evidence concerns names, file changes or completion results.

## Connect a separate equipment installation where needed

If the surrounding platform project also needs equipment mounting or external IT cabling, Leviathan's rack-and-stack service and project inquiry below address that physical work. The agreed scope can include equipment mounting, physical IT cabling, labels and installation records.

Share a nonconfidential equipment summary, site, released rack positions and connection requirements, and required physical handoff to discuss scope and availability. Loader implementation and filesystem administration remain with the appointed software and storage teams.

References: [L1](https://www.leviathansystems.co/services/rack-and-stack)

## Primary sources

- [D1 — Linux man-pages 6.19: dup(2), February 8, 2026](https://man7.org/linux/man-pages/man2/dup.2.html). Checked 2026-10-21. Explains duplicated descriptors sharing an open file description, offset and file status flags, while file descriptor flags remain separate.
- [O1 — Linux man-pages 6.19: open(2), February 8, 2026](https://man7.org/linux/man-pages/man2/open.2.html). Checked 2026-10-21. DESCRIPTION and NOTES distinguish a descriptor, its open file description and the file; separate opens can have separate descriptions for one inode. File stability is a premise of CURSOR62.
- [R1 — Linux man-pages 6.19: read(2), February 8, 2026](https://man7.org/linux/man-pages/man2/read.2.html). Checked 2026-10-21. Seekable-file reads use the current offset and advance it by the actual successful byte count. The example stipulates serial two-byte successes rather than assuming every request is full.
- [L1 — Leviathan Systems: Rack-and-Stack & Colocation Installation](https://www.leviathansystems.co/services/rack-and-stack). Checked 2026-10-21. Agreed equipment mounting, physical IT cabling, labels and installation records; the equipment, site requirements and availability determine the physical engagement.

## Related Leviathan resources

- [Pathname replacement and retained open readers](/articles/model-file-path-replacement-versus-open-reader)
- [Hard-link names and shared mutable file identity](/articles/ai-model-hardlink-names-shared-file-identity)
- [io_uring read completions and returned-byte accounting](/articles/ai-io-uring-read-completion-returned-byte-count)
- [Rack-and-stack physical installation scope](/services/rack-and-stack)
- [Discuss a separate equipment installation project](/contact?service=rack-and-stack&from=%2Farticles%2Fai-file-readers-shared-open-description-cursor)

## Does the platform project also need equipment installed?

Share a nonconfidential equipment, site, rack-position and IT connection outline to discuss the separately agreed physical installation scope, handoff and availability.

[Discuss the scope](/contact?service=rack-and-stack&from=/articles/ai-file-readers-shared-open-description-cursor)
