FileAttr() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns information about an open file. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

FileAttr( filenum, attribute )

filenum is the number of a file opened through an Open File statement.

attribute is a code indicating which file attribute to return; see table below.

Return Value

LargeInt value

Description

The FileAttr() function returns information about an open file. The attribute parameter must be one of the codes in this table:

attribute parameter ID Return Value
FILE_ATTR_MODE 1 Small integer, indicating the mode in which the file was opened. Return value will be one of the following:
  • MODE_INPUT (0)
  • MODE_OUTPUT (1)
  • MODE_APPEND (2)
  • MODE_RANDOM (3)
  • MODE_BINARY (4)
FILE_ATTR_FILESIZE 2 Integer, indicating the file size in bytes.

Error Conditions

ERR_FILEMGR_NOTOPEN (366) error is generated if the specified file is not open.

See Also:

EOF() function, Get statement, Open File statement, Put statement