Initializing help system before first use

pathcheck

pathcheck


Purpose
Expand a path name and check whether it can be accessed.
Synopsis
int pathcheck(XPRMcontext ctx,const char *path,char *fullpath, int maxlen,int acc);
Arguments
ctx 
Mosel's execution context
path 
Path (or file name) to be processed
fullpath 
Buffer to return the expanded path
maxlen 
Size of fullpath
acc 
Operation to perform. Possible values:
XPRM_RCHK_READ 
Check whether path or file can be read
XPRM_RCHK_WRITE 
Check whether path or file can be written
XPRM_RCHK_NOCHK 
Only expand the path without testing access
XPRM_RCHK_IODRV 
Check whether the path includes an IO driver and expand "tmp:"
Return value
0 if successful, 1 if access is denied and a negative value in case of error ( e.g. buffer too small).
Further information
1. This routine returns an absolute path to the file name it gets as input and optionally checks whether access is allowed according to the current restrictions.
2. The function will return an error code if option XPRM_RCHK_IODRV is used and the provided path includes an IO driver different from ":" (default driver) and "tmp:" (temporary directory). With this option, the prefix "tmp:" is replaced by the absolute path to the temporary directory and ":" is removed before path expansion. Note that in this mode the leading blanks of the input string are trimmed before any processing.