Returns information about an open file.
||An expression that resolves to a file variable name used to refer to the file in Caché MVBasic.
||An expression that resolves to an integer code used to specify what file information to return. Available values are 0 through 3.
The following are the available key
options and return values:
||File variable: 1 if filevar is valid. Otherwise 0.
||VOC name: The VOC name of a MultiValue file. For example, myfile. If filevar does not refer to a MultiValue file, returns a null string.
||Pathname or global name: For a MultiValue file, the name of a Caché global variable. For example, ^|"USER"|myfile. For a sequential file, the fully-qualified pathname of the file, as specified in the OPENSEQ statement. If the file does not exist, this is returned as a directory path.
||File storage type: 0=unknown. 1=top level global (static hashed file) the default for MultiValue data files. 2=subscripted global subnode. 4=directory. 5=sequential file.
Other MultiValue implementations may support higher key
option values; these are not supported by Caché MVBasic.
The following example opens a sequential file, tests the file variable, then uses the file variable to return the file's pathname and the file type (in this case, type 5):
OPENSEQ "C:\temp\file1" TO myfile
THEN PRINT "valid file variable"
ELSE PRINT "file variable not valid"
PRINT "File pathname is:",FILEINFO(myfile,2)
PRINT "File type is:",FILEINFO(myfile,3)
© 1997-2019 InterSystems Corporation, Cambridge, MA