More...
Classes for operating system services, and assorted other things
See below for an overview of the classes in this module.
Prerequisite
Review Status
- Reviewed By:
- Paul Shannon
- Date Reviewed:
- 1995/06/02/
Etymology
'OS' is the standard abbreviation for 'Operating System'.
Synopsis
This module's main purpose is to provide convenient and uniform access to operating system features: environment variables, file and directory access, time and date services, and uniform data representation (which solves the variety of ways the fundamental data types are represented in hardware).
The following functionality is available:
-
Class EnvironmentVariable for access to environment variables.
-
Class Path, RegularFile, SymLink, and Directory for dealing with the file system. Note that module IO deals with reading and writing data to files and other IO streams.
-
Class Time to get the system time.
-
Class Timer to measure elapsed, user, and system time of a piece of code.
-
Framework Conversion to convert data from one format to another. There are classes to convert to/from canonical format, VAX format, and IBM/360 format. The structure of the framework is shown in the OMT diagram.
-
A class to encapsulate Memory usage. Class MemoryTrace makes it possible to trace all memory (de)allocations through malloc and free (new and delete). It only works on Linux systems though.
Example
See the various class header files.
Motivation
We want to provide a simple and uniform interface to OS services and features for the application and library programmer. To pick a few examples:
-
Recursive deletion of a directory.
-
Access to time and date information.
-
Get and set environment variables.
To Do
-
The OS module is a bit fuzzy: for example, canonical data format conversion is more a matter of hardware than of operating system differences. Perhaps these particular classes should be moved to a new module.
-
Time and Date classes should be revised after studying similar classes designed by others. Roel Martinez is tenatively scheduled to do this in the late summer of 1995.
-
There was once some discussion of a 'VOS' (virtual operating system) module. This seems like a good idea. Nested subdirectories for specific operating systems would contain the implementations, but a common interface would be used for all. And perhaps local site makedefs could be used to select the proper implementation to link against, with no special action required of the programmer.