LibreOffice 24.8 Help
āĻāĻĒā§āĻ¨ āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻā§āĻ° āĻŽāĻžāĻ§ā§āĻ¯āĻŽā§ āĻā§āĻ˛āĻž āĻāĻāĻāĻŋ āĻĢāĻžāĻāĻ˛ā§āĻ° āĻĒā§āĻ°ā§ā§āĻāĻ¨ āĻŽā§āĻĄ āĻ āĻĨāĻŦāĻž āĻĢāĻžāĻāĻ˛ āĻĒā§āĻ°ā§ā§āĻ āĻā§āĻ°āĻŽ āĻĒā§āĻ°āĻĻāĻžāĻ¨ āĻāĻ°ā§ āĻĨāĻžāĻā§āĨ¤ āĻĢāĻžāĻāĻ˛ āĻĒā§āĻ°ā§ā§āĻ āĻā§āĻ°āĻŽāĻāĻŋ āĻ āĻĒāĻžāĻ°ā§āĻāĻŋāĻ āĻ¸āĻŋāĻ¸ā§āĻā§āĻŽā§āĻ° āĻāĻĒāĻ° āĻ¨āĻŋāĻ°ā§āĻāĻ°āĻļā§āĻ˛ (OSH = Operating System Handle)āĨ¤
If you use a 32-Bit operating system, you cannot use the FileAttr function to determine the file access number.
āĻāĻ°āĻ āĻĻā§āĻā§āĻ¨: āĻā§āĻ˛ā§āĻ¨
FileAttr (Channel As Integer, Attributes As Integer)
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 - 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, "This is a line of text"
MsgBox FileAttr(#iNumber, 1), 0, "Access mode"
MsgBox FileAttr(#iNumber, 2), 0, "File attribute"
Close #iNumber
End Sub