Record-oriented filesystem
From Wikipedia, the free encyclopedia
This article or section is in need of attention from an expert on the subject. Please help recruit one or improve this article yourself. See the talk page for details. Please consider using {{Expert-subject}} to associate this request with a WikiProject |
In computer science, a record-oriented filesystem is a file system where files are stored as a collection of records. There are several different record formats: fixed-length or variable length, and different physical organizations or padding mechanisms, metadata is associated with the file records to define the record length. Different methods to access records may be provided, for example sequential, by key or by record number.
Contents |
[edit] Origin
Record-oriented filesystems are frequently associated with mainframe and midrange operating systems, such as MVS[citation needed], DOS/VSE or VMS.
Record-oriented filesystems can be supported on media other than direct access disk. A deck of punched cards can be considered a record-oriented file. A magnetic tape is an example of media which can support records of uniform length or variable length.
In a record file system, one program writes a collection of data (a record). The programs reading that file has an understanding of the collection comprising the record as defined by the writer. Each record has a length as defined by the writer. There is no restriction on the bit patterns composing the data record, i.e. there is no delimiter character. It is permitted to read only the beginning of a record, the next sequential read returns the next collection of data (record) that the writer intended to be grouped together.
Some operating systems require that library routines specific to the record format be included in the program. This means that a program originally expected to read a variable length record file cannot read a fixed length file. These operating system must provide file system utilities for converting files between one format and another. This means copying the file (which requires additional storage space, time and coordination) may be necessary.
Other operating systems include various routines and associate the appropriate routine, based on the file organization, at execution time.
In either case significant amounts of code to manage records must be provided in protected routines to insure file integrity.
An alternate to a Record-oriented file is a stream. In a stream file the filesystem treats files as an unstructured sequence of bytes. A delimiter character ( a reserved bit pattern) may be inserted by the writer application to separate records. The read routine provides as many bytes as requested, not to exceed the size of the file. It is the responsibility of the reading application program to recognize the delimiter, not the file system library routines. This approach significantly reduces the size and complexity of the library and reduces the number of utilities required to maintain files.
[edit] Advantages and Costs
A record oriented file has several advantages. After a program writes a collection of data as a record the program that reads that record has the understanding of that data as a collection. Although it is permitted to read only the beginning of a record, the next sequential read returns the next collection of data (record) that the writer intended to be grouped together. Another advantage is that the record has a length and there is no restriction on the bit patterns composing the data record, i.e. there is no delimiter character.
There is a cost associated with record oriented. The length definition takes up space. On a magnetic tape that definition takes the form of an inter-record gap. On a disk a meta data area must be allocated. This is minimal in a file where all the records are the same length. On a file composed of varying length records a maximum record length is defined to determine the size of the length metadata associated with each record.
[edit] References
This article does not cite any references or sources. (March 2007) Please help improve this article by adding citations to reliable sources. Unverifiable material may be challenged and removed. |