Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>No. Not in the Unix world, at any rate.</p> <p>If you look inside DBMS or Unix(ish) file system internals, they can easily truncate or extend datasets at the beginning, at the end, or anywhere in the middle. But they don't export that functionality; it's not part of the Unix API heritage or the POSIX standard, so any "truncate at beginning" or "extend at beginning" APIs would be non-standard ("proprietary").</p> <p>The marginal utility of such functions is also unclear. Who would use them? How often? </p> <p>Unix files (flat sequences of bytes/characters) have proven themselves simple and effective for application code, but a poor foundation for layered data structures. Twenty five years ago that statement was debatable; today it's just an observed historical reality.</p> <p>Unix developers used to argue "all things can be reduced to files" and "we can ace random access through clever seeking." Those claims never quite worked out, however. Unix never, for example, matched the random-access record management prowess of minicomputer and mainframe operating systems (e.g. DEC RMS, IBM ISAM and VSAM). And while those implementing file systems, queues, tries, relational databases, and object stores do occasionally drop contents into files, and they use files for sequential operations like logging, but they rarely depend on character streams as their low-level format. Instead they use structures like B-trees and hash tables to directly manage disk blocks, memory segments, and other underlying resources. </p> <p>Character streams belong with tables, documents, and objects--abstractions suitable for client applications. If you want a queue, consider using existing middleware (e.g. RabbitMQ, ZeroMQ, REDIS, some DBMS manager) that already has this covered. If you must build it yourself, you'd probably wouldn't build it atop a simplistic character stream abstraction. So while truncate/extend at beginning is potentially useful for some things (log trimming instead of segmented log rotation, e.g.), it's unlikely to be a Big Win for most data structure implementations.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload