FileSystem.FileAttr(Int32) 메서드

정의

FileOpen 함수를 사용하여 연 파일의 파일 모드를 나타내는 열거형을 반환합니다. FileSystem을 사용하면 FileAttr 함수를 사용할 때보다 파일 I/O 작업의 생산성 및 성능이 향상됩니다. 자세한 내용은 GetFileInfo(String)를 참조하세요.

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

매개 변수

FileNumber
Int32

필수 요소. Integer. 유효한 파일 번호입니다.

반환

다음 값 중 하나입니다.

파일 액세스 모드
1OpenMode.Input
2OpenMode.Output
4OpenMode.Random
8OpenMode.Append
32OpenMode.Binary

예제

이 예제에서는 함수를 FileAttr 사용하여 열린 파일의 파일 모드를 반환합니다.

Dim mode As OpenMode
FileOpen(1, "c:\TESTFILE.TXT", OpenMode.Input)
mode = FileAttr(1)
MsgBox("The file mode is " & mode.ToString())
FileClose(1)

설명

이 함수는 함수를 사용하여 연 파일의 파일 모드를 나타내는 열거형을 반환합니다 FileOpen .

적용 대상

추가 정보