Description
Initializes or renames a location (typically a folder). It assigns a label to the location and builds a location directory, creating a media map in the folder.
Syntax
Name_Volume (location, identifier)
Parameters
Parameter | Description |
---|---|
location | The location (fully qualified path name, or relative path from the location of OINSIGHT.EXE). |
identifier | The name to be given to the location. The identifier cannot contain spaces or quotes. If omitted, returns the current identifier for the location. |
Media Map
Name_Volume creates a REVMEDIA file (REVMEDIA.LK and REVMEDIA.OV) in the specified location, if it does not exist. The volume identifier is stored in field 2 of the %%REVMEDIA%% record. Field 1 of the %%REVMEDIA%% record contains the revmedia name to assign to the next file to be created.
Note: You cannot rename a location that contains tables that have been indexed.
Caution: It is important that each location created in OpenInsight have a unique name. This is especially important in environments where users may have access to network drives but can also attach locations from local drives. Failure to ensure uniqueness of locations can result in incorrect updates of indexes.
See Also
Chapter 8: CREATE.MEDIA MFS call
Example (System Monitor)
From the System Monitor, running the following command:
RUN NAME_VOLUME 'C:\DATAFOLDER', 'MYDATA'
will initialize the location C:\DATAFOLDER with a media map named MYDATA, if no media map exists. If a media map exists in C:\DATAFOLDER, its identifier is renamed to MYDATA. The System Monitor output will be:
C:\DATAFOLDER, MYDATA,
Example (BASIC+ code)
/* associating C:\DATAFOLDER with the identifier MYDATA from code */ declare subroutine name_volume name_volume ('C:\datafolder', 'MYDATA')