Skip to content

Experimental file I/O API, inspired by POSIX pread() - #193

Open
shattered wants to merge 1 commit into
davidgiven:masterfrom
shattered:_4c830111
Open

shattered wants to merge 1 commit into
davidgiven:masterfrom
shattered:_4c830111

Conversation

@shattered

Copy link
Copy Markdown
Contributor

Good thing we're not limited by single 64 KB address space and block-aligned I/O any more, eh?

Comment thread rt/cpm/stdio.coh

# if pos or len are not block-aligned, do multiple reads and use FCB buffer to copy

sub stdio_pread(fcb: [FCB], dma: [uint8], len: FCBIndexType, pos: uint32): (amount: StdioType) is

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will need to flush any unwritten changes still in the FCB buffer.

For CP/M it may be worth not implementing pread/pwrite directly, but instead implementing it on top of the existing seek/read/write routines. CP/M is so slow that the extra overhead of copying the data a byte-at-a-time in and out of the buffer is probably not going to do too much to performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants