LibreOffice 25.2 abi
Tagastab lause Open abil avatud faili juurdepääsurežiimi või faili lugemise numbri. Faili lugemise number sõltub operatsioonisüsteemist (OSH = Operating System Handle, operatsioonisüsteemi pide).
If you use a 32-Bit operating system, you cannot use the FileAttr function to determine the file access number.
Vaata ka: Open
  FileAttr (Channel As Integer, Attributes As Integer)
Täisarv
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.
Kui määrad parameetri atribuudi väärtuseks 1, siis kehtivad järgmised tagastusväärtused:
1 - INPUT (fail on sisestuseks avatud)
1 - OUTPUT (fail on väljastuseks avatud)
4 - RANDOM (fail on juhuslikuks juurdepääsuks avatud)
8 - APPEND (fail on lisamiseks avatud)
32 - BINARY (fail on avatud kahendrežiimis).
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, "See on rida teksti"
    MsgBox FileAttr(#iNumber, 1), 0, "Access mode"
    MsgBox FileAttr(#iNumber, 2), 0, "File attribute"
    Close #iNumber
End Sub