[go: up one dir, main page]

|
|
Log in / Subscribe / Register

SAM / DAM files

SAM / DAM files

Posted Apr 11, 2022 18:28 UTC (Mon) by joib (subscriber, #8541)
In reply to: SAM / DAM files by Wol
Parent article: Readahead: the documentation I wanted to read

> An OS I used in the past (Pr1mos, what else :-) flagged all files as either SAM or DAM. From the coder's POV there was no real difference between the two - the same primitives worked the same way on all files. But the S and D stood for Sequential and Direct, and the documentation was very clear that sequential files were meant to be read from the beginning, while Direct files were quite happy reading random blocks.

Sounds like an OS designed for Fortran, which has sequential access and direct access I/O. Or well, nowadays Fortran additionally has stream access as well, which is more like the stream of bytes model Unix and Windows provide. Fortran sequential files allow stepping forwards or backwards one record at a time (or going all the way to the beginning or end), but going forwards or backwards N records is an O(N) operation. Direct access, conceptually, is a bunch of fixed size records allowing access in any order.

Needless to say, on a modern day OS which provides only the stream-of-bytes model, it's the task of the Fortran runtime library to implement direct and sequential access on top of the stream-of-bytes model that the OS provides.

> Is there any way this sort of information could be fed through to these routines, because there's clearly no point reading-ahead a dam file, while there is no point caching a sam file once that bit of data has been synchronously read ...

At least from the perspective of the typical Fortran applications I've seen, this would be a very simplistic and bad caching strategy. For instance, reading direct access files sequentially (as in, first read record #1, then record #2, etc) is actually very common, as is rereading files (maybe by rerunning the applications with partially different input parameters etc.).


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds