FileAttr Function

खुला कथन सँग खुलेको फाइलको पहुँच मोड वा फाइल पहुँच नम्बर फर्काउँदछ । यो फाइल पहुँच नम्बर सञ्चालित प्रणाली(OSH = Operating System Handle)मा निर्भर गर्दछ ।

द्रष्टव्य प्रतिमा

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


यो पनि हेर्नुहोस्: खोल्नुहोस्

Syntax:


  FileAttr (Channel As Integer, Attributes As Integer)

Return value:

इन्टिजर

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.

यदि तपाईँले १ को मान सँग परामिति विशेषताहरू निर्दिष्ट गर्नु भएको खण्डमा दिएका फिर्ता मानहरू लागू गर्नुहोस्:

१ - INPUT (आगतका लागि फाइल खोल्नुहोस्)

२ - OUTPUT(निर्गतका लागि फाइल खोल्नुहोस्)

४ - RANDOM(अनियमित पहुँचका लागि फाइल खोल्नुहोस्)

८ - APPEND (जोड्नका लागि फाइल खोल्नुहोस्)

३२ - BINARY (बाइनरी मोडमा फाइल खोल्नुहोस्)

त्रुटि सङ्केतहरू

5 अवैध कार्य-विधि कल

52 खराब फाइल नाम वा नम्बर

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
    #iNumber, "यो पाठको लाइन हो" मुद्रण गर्नुहोस्
    MsgBox FileAttr(#iNumber, 1), 0, "Access mode"
    MsgBox FileAttr(#iNumber, 2), 0, "File attribute"
    Close #iNumber
End Sub

कृपया हामीलाई समर्थन गर्नुहोस्!