Volume, directory, and file considerations

Programming for optical devices can be easier if you understand these considerations for volumes, directories, and files.

Volume considerations

Consider the following terms when referring to volumes:
The volume is mounted in a drive under the read/write heads.
Near online
The volume is in the optical media library, but not online. The volume can be in a storage slot or the opposite side of an online volume.
The volume is not physically in an optical media library, but volume information for the volume is kept when the volume is removed.
The volume is in an optical device, but the device is powered off, varied off, or no longer connected.
Consider the following characteristics of optical volumes:
  • An optical volume is one side of an optical cartridge.
  • Some optical cartridges contain two volumes, others contain one.
  • All volume names must be unique.
  • Depending on the optical media density and type, the capacity of a volume can range from a few hundred megabytes to many gigabytes.
  • Normally, a near online volume takes less than 10 seconds to become an online volume. This requires the volume to be mounted into a drive.
  • The number of drives in the optical media library determines how many volumes can be online at any time. Only one volume can be mounted in a drive (online) at one time. The remaining volumes in the library are near online.
  • Volumes are generally independent of each other, with one exception. The two volumes on the same cartridge can never be completely independent. Both volumes on a cartridge can never be online at the same time. Copying between two volumes on the same cartridge can be done, but it requires the cartridge to be flipped several times to copy all of the requested files.
  • There is no limit to the number of removed volumes that can exist.

How an application manages volumes depends almost entirely on the requirements of the application. Data need to be written to volumes strategically, depending on the required retrieval time in the future. If it is not desirable to wait for a near online volume to become online, the application might need to be set up so that the most likely volumes to be accessed are online.

Directory considerations

The only limit to the number of directories that can be created on a volume is the capacity of the media. This restriction also applies to the number of files that can exist in an optical directory. Directories are not required to exist for files to be stored on a volume. If you want, all files can be stored in the root directory of a volume. The root directory is the "/" directory that is created when a volume is initialized. This root is not considered a directory in the traditional sense since it cannot be created or deleted like other directories. The root directory will always exist on initialized optical volumes.

Directories can be used to categorize optical files into more manageable subsets. Directories can contain files from a particular time period, subject, characteristic, or any combination of these. For example, there may be a directory SPOOLFILES with subdirectories YEAR_1994 and YEAR_1995. Taking this one step further, there can be subdirectories within these subdirectories named MONTH_MARCH and MONTH_APRIL. The following example contains the fully qualified directory names:

Directories can be useful when categorizing files, but they are not necessary. Like volume names, directory names must be unique within the same volume. For example, volume VOL001 cannot have two directories named DIR001. Volume VOL001 can, however, have a DIR001 directory and a DIR000/DIR001 directory. Also, a DIR001 directory can exist on volume VOL001 and volume VOL002. For information about directory naming conventions, see Path names requirements.

File considerations

The size of optical files depends almost entirely on the requirements of the application and the users of those files. The size of an optical file can range from 0 bytes to 9 999 999 827 968 bytes (accessible through the integrated file system) or 4 294 705 152 bytes (accessible through HFS) depending on the capacity of a volume.

When selecting optimal file sizes for your application, pay special attention to the following considerations:
  • The amount of system disk unit or main storage on the system
  • How the data will be read (sequentially or randomly)
  • Whether the entire file will typically be retrieved, or just a small portion
  • Whether files will be updated once they are written to the volume

Generally, the larger the file, the better the performance and media use. When larger files are used, less media space is taken up by file directory information and more is used for actual data. Also, the performance related to file size is not a linear comparison. It does not take twice as long to write 20 KB of data as it does to write 10 KB of data. Performance (KB/second) improves as the amount of data being read or written increases.