Skip to main content

FileAttr function (LotusScript Language)

Returns the access type, or the operating system file handle, for an open file.

Syntax

FileAttr ( fileNumber , attribute )

Elements

fileNumber

The number associated with the file when you opened it.

attribute

A number (either 1 or 2) specifying the type of information you want. Instead of 1 or 2, you can specify the constant ATTR_MODE or ATTR_HANDLE, respectively. These constants are defined in the file lsconst.lss. Including this file in your script allows you to use constants instead of their numeric values.

Return value

If attribute is ATTR_HANDLE, then FileAttr returns the operating system file handle for the file.

If attribute is ATTR_MODE, then FileAttr returns an integer representing the access for the file, as shown in the following table.

Return valueAccessConstant
1InputATTR_INPUT
2OutputATTR_OUTPUT
4RandomATTR_RANDOM
8AppendATTR_APPEND
32BinaryATTR_BINARY

Example