fspec2host Function

Converts an AMOS file specification to a host path.

Syntax

IMiameLib.fspec2host(Amos, Host, Extn, Flg)

Parameters

Amos

A String value containing an AMOS format file specification which is to be converted into a native Windows path, such as DSK0:TEST.DAT[11,11].

Host

A String variable into which the native Windows path is returned, for example C:\VM\MIAME\DSK0\011011\TEST.DAT.

Extn

A String value containing the default file extension to be included in the returned host path if none is specified in the given AMOS format file specification.

Flg

A MiameFspecFlagEnum bitmapped value which determines exactly how the file specification is to be processed.

Return Value

A MiameDdbErrEnum error value detailing any error which occurred while processing the file specification. A zero value is returned if there was no error. These return values correspond exactly to standard AMOS file system error codes.

Remarks

The fspec2host function is primarily used to perform a straight conversion from an AMOS format file specification to a local Windows full pathname, but may also be used simply for validity checking of file specifications or device specifications. The exact behaviour is determined by the value of the bitmapped Flg parameter. The following table indicates the meaning of each value:

MiameFspecFlag

Enum Value

Meaning

_fs_std

Performs a standard conversion. The host pathname parameter is returned as the Windows mapping of the specified amos parameter file specification. The amos may already specify a local pathname.

_fs_fma

The amos file specification is validated and split into its component parts. These parts may be subsequently mapped onto a local pathname with a further call specifying _fs_toh.

_fs_toh

A previously analysed AMOS file specification is mapped onto a local pathname and returned in the host pathname parameter.

_fs_drv

This value may be specified in conjunction with _fs_fma or _fs_toh, but not _fs_std. It indicates that validation and decomposition of the AMOS file specification, or construction of the host pathname is to work with the AMOS device specification only – any filename is to be ignored.

_fs_fex

This value may be specified in conjunction with _fs_std only. The default extension is normally only applied to the returned local pathname, if the initial AMOS file specification contained a valid PPN. This value forces additional of the default file extension even if the PPN is invalid.

 

The value _fs_std is the same as the sum or logical OR of the values _fs_fma and _fs_toh. However, using two consecutive calls to fspec2host - the first specifying _fs_fma and the second specifying _fs_toh is very slightly different, as, in this scenario the amos parameter must contain an AMOS format file specification, and cannot contain a Windows pathname.