FileExists() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
ft:locale
en-US
Product name
MapBasic
ft:title
MapInfo MapBasic Reference
First publish date
1985
ft:lastEdition
2023-09-12
ft:lastPublication
2023-09-12T16:32:32.686000

Purpose

Returns a logical value indicating whether or not a file exists. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

FileExists( filespec )

filespec is a string that specifies the file path and name.

Return Value

Logical: TRUE if the file already exists, otherwise FALSE.

Example

If FileExists("C:\MapInfo\TODO.TXT") Then 

	Open File "C:\MapInfo\TODO.TXT" For INPUT As #1

End If 

See Also:

TempFileName$() function