Record-oriented filesystem
From Wikipedia, the free encyclopedia
In computer science, a record-oriented filesystem is a file system where files are stored as a collection of records. Generally, these systems support several different record formats: either fixed-length and variable length, different lengths, and different physical organisations or padding mechanisms; metadata associated with the file records its format. Frequently, different access methods are supported: sequential, or key-indexed.
Sometimes, files can be divided into several members, such as partitioned datasets under MVS. This file organisation is justified by the limited directory capabilities that mainframe systems have traditionally had, which originated before the popularisation of hierarchical filesystems.
Contents |
[edit] Origin
Record-oriented filesystems are particularly associated with mainframe and midrange operating systems, such as MVS, VM/CMS, DOS/VSE, OS/400 and VMS. On such systems, the operating system will generally provide utilities for converting files between one format and another.
Record-oriented filesystems generally reflect a heritage in punched cards, business data processing and unit record equipment. Files stored in punched cards naturally consist of records of fixed length (that length being the card width, generally 80 characters but sometimes more).
The Unix/POSIX philosophy, by contrast, which PC/desktop operating systems follow (including DOS, Windows, Windows NT, OS/2 and Mac OS), is for the filesystem to treat files as an unstructured sequence of bytes. Any division into records is up to each individual application. Newer record-oriented systems, due to the desire for POSIX compatibility, support POSIX-style stream-oriented files as well. This reflects the heritage of punched paper tape, such as that produced by the Teletype Model 33 ASR, a teletypewriter often used as a terminal/console for early "mini-computers" in the 1960s and 1970s. Thus, the stream-oriented file system simulates punched paper tape in the same way that mainframe files simulate punched cards.
This is also reflected in the storage of source code. Under Unix, source code is normally stored as a sequence of lines separated by linefeeds, or in other words as variable length records with a delimiter (although that is merely a convention adopted by compilers, editors, and other tools, not one enforced by the filesystem.) By contrast, on many mainframe systems, source code is stored in fixed-length 80 character records, padded with spaces, but not separated by any form of newline character or character sequence. This reflects its heritage as having originally been read from punched cards.
[edit] Comparison with stream-oriented file system
Today, the UNIX approach is far more common. Defenders of stream-oriented files argue for their greater flexibility and simplicity. In particular, tools to process files no longer need to know about many different record formats — one might argue the rich library of command line utilities available with UNIX are made possible by a single file format. They also argue that all the additional complexity of record-oriented files, key sequenced access methods, etc., can be provided by applications and libraries, without needing to complicate the operating system.
Defenders of record-oriented filesystems argue that supporting record formats and key sequenced files in the operating system make it less likely that multiple applications will use incompatible file formats.