LibreOffice 7.3 Help
Vraća pristupni mod ili pristupni broj datoteci od datoteke koja je otvorena sa iyrayom Open. Pristupni broj datoteci je broj koji je zavisi od operativnog sustava (OSH = Operating System Handle)
Ako koristite 32-bitni operativni sustav, nemozete koristiti FileAttr-Funkciju da odredite pristupni broj datoteci.
See also: Open
FileAttr (FileNumber As Integer, Attribute As Integer)
Cijeli broj
FileNumber: The number of the file that was opened with the Open statement.
Attribute: Integer expression that indicates the type of file information that you want to return. The following values are possible:
1: The FileAttr-Function označava pristupni mod datoteke
2: The FileAttr-Function returns the file access number of the operating system.
If you specify a parameter attribute with a value of 1, the following return values apply:
1 - ULAZ (datoteka je otvorena za čitanje)
2 - IZLAZ (datoteka je otvorena za pisanje)
4 - SLUČAJNO (datoteka je otvorena za slučajan pristup)
8 - DODAVANJE (datoteka je otvorena za dodavanje)
32 - BINARNO (datoteka je otvorena kao binarna)
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, "This is a line of text"
MsgBox FileAttr(#iNumber, 1), 0, "Access mode"
MsgBox FileAttr(#iNumber, 2), 0, "File attribute"
Close #iNumber
End Sub