The File System m ust store data on disc in an e￿cien t manner, since ￿les are constan tly manipulated: added, deleted, and updated. It uses demand paged virtual memory to manage virtual memory and the user in terface to ￿les. This occurs transparen tly from the user's perspective. P age-sized portions of ￿les are sw apped into memory only when needed.

The user-de￿ned elements of a disc ￿le are those within y our control. Elements you can specify include:

Which disc (or discs) the ￿le will reside on.

Record type, size, and access.

For detailed information on record t ypes and elements you can specify, refer to the \Record Structure" subsection and Accessing Files Pr ogrammer's Guide (32650-90017).

Disc File Storage

The File System ph ysically stores a ￿le on disc b y breaking it into extents and maintaining pointers to where each extent resides. It logically stores a ￿le based on where the ￿le reference indicates the ￿le belongs in the directory structure. Both concepts are discussed in Chapter 1, \Overview."

The group speci￿ed for a ￿le in the standard ￿le reference format

(￿lename.groupname.acctname) determines the v olume set on which the ￿le resides. You can select the volume set, v olume name, and class for a ￿le b y using the HPFOPEN intrinsic.

Most common uses of ￿les do not require speci￿cation of v olume sets or classes, but it is sometimes useful to restrict a ￿le to a particular v olume or group of v olumes. If a ￿le resides on only one volume, then damage to other discs will not destro y the ￿le. However, when a volume speci￿cation is giv en, the File System distributes exten ts throughout a v olume set to prevent one physical disc from running out of space.

Disc storage is logically partitioned in to:

Volume, which is a physical disc and a mem ber of a volume set. It ma y also be a member of one or more volume classes. It is remo vable while the system is running, is automatically recognized and moun ted by the system, and the operator is noti￿ed when an unmoun ted volume is requested.

Free space is tracked by a separate free space bit map on eac h individual disc volume. To ￿nd space to put a new disc ￿le, sev eral tables ma y be checked. You can display disc space information by running DISCFREE.PUB.SYS .

Volume set, whic h consists of a maxim um of 255 volumes or volume classes. It pro vides a way of partitioning user data in to removable entities and are used only for permanen t storage space.

The directory structure is spread across a v olume set. Each volume has a label object, whic h contains the ￿le labels for ￿les. The directory has no arbitrary limit to the n umber of ￿les per volume. The system disc is usually con￿gured to be LDEV 1.

Volume class, whic h can contain a maximum of 255 volumes and is optional within a v olume set. You cannot mount a disc by a volume class designation; it is used exclusiv ely to allocate disc storage space.

6-4 File System