Довідка LibreOfficeDev 25.8
Повертає режим доступу або номер доступу до файлу, відкритого інструкцією Open. Номер доступу до файлу залежить від операційної системи (OSH = Operating System Handle, тобто дескриптор операційної системи).
If you use a 32-Bit operating system, you cannot use the FileAttr function to determine the file access number.
Див. також: Open
  FileAttr (Channel As Integer, Attributes As Integer)
Ціле число
Channel: The number of the file that was opened with the Open statement.
Attributes: Integer expression that indicates the type of file information that you want to return. The following values are possible:
1: FileAttr indicates the access mode of the file.
2: FileAttr returns the file access number of the operating system.
Якщо для параметра Атрибут вказується значення 1, то можуть бути повернуті такі значення:
1 - INPUT (файл відкритий для запису)
2 - OUTPUT (файл відкритий для виведення)
4 - RANDOM (файл відкритий для довільного доступу)
8 - APPEND (файл відкритий для додавання)
32 - BINARY (файл відкритий у двійковому режимі).
Sub ExampleFileAttr
    Dim iNumber As Integer
    Dim sLine As String
    Dim aFile As String
    aFile = "C:\Users\ThisUser\data.txt"
    iNumber = Freefile
    Open aFile For Output As #iNumber
    Print #iNumber, "Це рядок тексту"
    MsgBox FileAttr(#iNumber, 1), 0, "Access mode"
    MsgBox FileAttr(#iNumber, 2), 0, "File attribute"
    Close #iNumber
End Sub