LogiView

Function 'exists'

     
This function verifies existence and access rights of the specified file.
  Syntax:
  {LOG_VAR}= exists({STR_EXPR},{"r"|"w"|"x"}) or
{LOG_VAR}= exists({STR_EXPR},{"r"|"w"|"x"},{"/CLIENT"})
 

I/O parameters:

{STR_EXPR} Name of file (including path).
{"r"|"w"|"x"} Check access rights:
"r" read access
"w" write access
"x" execution
"/CLIENT" Check on client side
-  
 

Return value:

 
{LOG_VAR}
TRUE File and access rights verified
FALSE File not found.
 

Example:

  Declaration of Variables
 
 10 C -- Pre-definiton of variables
 20   DOCU_INT_2 = 0 
 30   DOCU_STRING_1 = "/tmp/test.seite"
 40 C -- If file is found on client computer and can be opened for 
         read access,
 50 if (exists(DOCU_STRING_1,"w", "/CLIENT")==TRUE) 
 60 C -- Open file for write access
 70    DOCU_INT_1 = open(DOCU_STRING_1,"w")	
 80 C  -- modify and close file
 90    .........
100 close(DOCU_INT_1)
110 else
120 C  -- file not found or write access not allowed 
130    put("This file cannot be accessed on the client computer!")
140 endif 
  Result:
  If the file is not found on the client computer or if write access is not allowed, an error message ("This file cannot be accessed on the client computer!") is displayed. Otherwise, the file is processed.

Functions and commands: File Interface