< Futurebasic < Language < Reference

USR FSFILEEXISTS(fsSpec)

Revised February, 2002 (Release 6)

Description - Your program may determine whether or not a file exists using this function. A non-zero value is returned when the file is present. You need to pass a file spec record which can be created using FN FBmakeFSSpec or by using a file spec version of the FILES$ function. To determine if a file named "My File" is present in the application folder your would use the following code.

INCLUDE "Util_Files.incl" DIM fs AS FSSpec FN FBmakeFSSpec(SYSTEM(_aplVol),0,"My File",fs) LONG IF USR FSFILEEXISTS(fs)

  PRINT "File exists!"

END IF Note: You will not be able to use this function unless you include the proper header file as follows:

INCLUDE "Util_Files.incl"

See Also USR FILEEXISTS;

Appendix H: File Spec Records; FILES$

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.