FileSystem.FileAttr(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns an enumeration representing the file mode for files opened using the FileOpen
function. The FileSystem gives you better productivity and performance in file I/O operations than the FileAttr
function. See GetFileInfo(String) for more information.
public:
static Microsoft::VisualBasic::OpenMode FileAttr(int FileNumber);
public static Microsoft.VisualBasic.OpenMode FileAttr (int FileNumber);
static member FileAttr : int -> Microsoft.VisualBasic.OpenMode
Public Function FileAttr (FileNumber As Integer) As OpenMode
Parameters
- FileNumber
- Int32
Required. Integer
. Any valid file number.
Returns
One of the following values:
Value | File access mode |
---|---|
1 | OpenMode.Input |
2 | OpenMode.Output |
4 | OpenMode.Random |
8 | OpenMode.Append |
32 | OpenMode.Binary |
Examples
This example uses the FileAttr
function to return the file mode of an open file.
Dim mode As OpenMode
FileOpen(1, "c:\TESTFILE.TXT", OpenMode.Input)
mode = FileAttr(1)
MsgBox("The file mode is " & mode.ToString())
FileClose(1)
Remarks
This function returns an enumeration representing the file mode for files opened using the FileOpen
function.