Difference between revisions of "FILE()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to check whether file exists
 
Function to check whether file exists
 
  
 
==Syntax==
 
==Syntax==
 
FILE(<expC>)
 
FILE(<expC>)
 
  
 
==See Also==
 
==See Also==
[[DIR()]], [[MENU FILES]], [[SET FILECASE]], [[SET PATH]]
+
[[DATABASEEXISTS()]], [[DIRECTORY()]], [[SET FILECASE]], [[SET PATH]], [[TABLEEXISTS()]]
 
+
  
 
==Description==
 
==Description==
 
The FILE() function returns .T. if the file exists and .F. otherwise.  FILE() checks for the existence of the file in the current directory, but not in the PATH (specified with the SET PATH TO command).  FILE() does not check the access permission of the specified file for writing, it only checks that the file can be opened for reading.  If no file extension is specified in the filename <expC>, then the file extension ".dbf" is concatenated to the end of the filename.  This means that FILE() cannot be used to check for the existence of files without extensions.
 
The FILE() function returns .T. if the file exists and .F. otherwise.  FILE() checks for the existence of the file in the current directory, but not in the PATH (specified with the SET PATH TO command).  FILE() does not check the access permission of the specified file for writing, it only checks that the file can be opened for reading.  If no file extension is specified in the filename <expC>, then the file extension ".dbf" is concatenated to the end of the filename.  This means that FILE() cannot be used to check for the existence of files without extensions.
 
  
 
==Example==
 
==Example==
Line 22: Line 18:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 09:43, 3 October 2012

Purpose

Function to check whether file exists

Syntax

FILE(<expC>)

See Also

DATABASEEXISTS(), DIRECTORY(), SET FILECASE, SET PATH, TABLEEXISTS()

Description

The FILE() function returns .T. if the file exists and .F. otherwise. FILE() checks for the existence of the file in the current directory, but not in the PATH (specified with the SET PATH TO command). FILE() does not check the access permission of the specified file for writing, it only checks that the file can be opened for reading. If no file extension is specified in the filename <expC>, then the file extension ".dbf" is concatenated to the end of the filename. This means that FILE() cannot be used to check for the existence of files without extensions.

Example

if file("names.ndx")
    erase names.ndx
endif