Index

open directory

Open a new archive or log file.

Mandatory Arguments:
ArcFile file
The type of file to create (archive or log).
Optional Arguments:
Wdir directory
The full name of the parent directory of the associated archive or log directory. When opening an archive-data file, the new file will be placed in a subdirectory of this directory, called arc/. When opening a log file, the new file will be placed in a subdirectory of this directory, called log/. If this argument is omitted, the new file will be created in the same directory as was last specified for this type of file.

Example:
The following example first opens archive and log files in arc and log subdirectories of the /scr/data directory. Subsequent files will continue to be created in the same sub-directories, unless another call to this function specifies a different parent directory.
  open archive, dir=/scr/data
  open log, dir=/scr/data
  ...
  open archive
  open log

Context:
When the control program starts, archive frames and log messages are not recorded on disk. To have them be written to files, the open must be used. By default these are written in the directory from which the cbicontrol program was started, but this may be overriden by using the optional dir argument to specify alternative destination directories. Once an alternative directory has been specified, this becomes the default directory for subsequent open commands for files of the same type.

Note that opening a new file automatically closes any existing file of the same type.

Also note that the names of log and archive files are not settable by the user. Instead they are composed from file creation date and time as follows: yyyymmdd_hhmmss.eee where yyyy is the four digit year, mm is the two digit month-number (1-12), dd is the day number within the month (1-31), hh is the hour into the day (0-23), mm is the minute into the hour (0-59), ss is the second into the minute (0-59), and eee is a three letter extension that enumerates the file type. The extension is .dat for archive data files and .log for log files.

The file names are used when reading archive files to determine which files to search in for data of a given time, so you shouldn't rename them.


Martin Shepherd (12-Oct-1998)