•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileEXIST(name$)

name$: sexp

By means of EXIST() one can determine whether a given file exists on a disk.
The parameter name$ contains the access path and the file name. The function
returns the value TRUE (-1), if the file exists, or FALSE (0) if not.

Example:

    OPEN "O", #1,"TEST.TXT"
    PRINT #1,"EXAMPLE"
    CLOSE #1
    PRINT EXIST("TEST.TXT")
    PRINT EXIST("TEST.DOC")

--> The file TEST.TXT is opened, some sample text is put in it, and the file is
    closed again. The value -1 (TRUE) is then printed, followed by 0 (FALSE),
    as the file TEST.DOC does not exist.

Also see: FSFIRST(), FSNEXT().

Memo: The EXIST() function seems to cause problems in desk accessories.
      EXIST() seems to cause a system crash if you attempt to change the
      resolution after it has been called at least once in a program. The
      EXIST() function ruins the command line. Either fetch the command line
      before using EXIST() or don't use EXIST(), instead call GEMDOS()
      directly.  Commands such as FILES, DIR, and FILESELECT also clobber the
      command line.

      Does not work well with long file names. Use fattrib() instead.

Fattrib()+