LibreOffice 7.6 Βοήθεια
Επιστρέφει την κατάσταση πρόσβασης ή τον αριθμό πρόσβασης ενός αρχείου που ανοίχτηκε με την πρόταση Άνοιγμα. Ο αριθμός πρόσβασης του αρχείου εξαρτάται από το λειτουργικό σύστημα (OSH = χειριστήριο λειτουργικού συστήματος).
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.
Αν ορίσετε την παράμετρο attribute με τιμή 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, "Λειτουργία πρόσβασης''
MsgBox FileAttr(#iNumber, 2), 0, "Γνώρισμα αρχείου"
Close #iNumber
End Sub