FileAttr Function

Haalata gahinsaa deebisi ykn lakkofsa gahiinsa faayilii kan hima banaa dhaan banamu.Lakkofsi gahiinsa faayilii sirna dalagaa (OSH= Qabannoo sirna dalagaa)

Sajoo Yaaddannoo

If you use a 32-Bit operating system, you cannot use the FileAttr function to determine the file access number.


Kanas ilaali: Bani

Syntax:


  FileAttr (Channel As Integer, Attributes As Integer)

Return value:

intergaa

Parameters:

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.

Yoo amaloota ulaagaalee gatii 1 ibsite, gatiin armaan kanaa gadii fayyadamee deebisa.

1 - INPUT (faayilii naqaaf banamu)

2 - OUTPUT (faayilii bahaaf banamu)

4 - RANDOM (faayilii gahiinsa darbee darbee banamuu )

8 - APPEND (faayilii miiltessaaf baname)

32 - BINARY (faayilii haalata lameetiin baname).

Error codes:

5 Ejjatoo fashalaan waamu

52 Maqaa faayiylii yookiin lakkoofsa yaraa

Example:


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
    Maxxansa #iNumber, "Kun Sarara barruuti"
    MsgBox FileAttr(#iNumber, 1), 0, "Access mode"
    MsgBox FileAttr(#iNumber, 2), 0, "File attribute"
    Close #iNumber
End Sub

Please support us!