다음을 통해 공유


basic_fstream::open

파일을 엽니다.

void open(
    const char *_Filename,
    ios_base::openmode _Mode = ios_base::in | ios_base::out,
    int _Prot = (int)ios_base::_Openprot
);
void open(
    const char *_Filename,
    ios_base::openmode _Mode
);
void open(
    const wchar_t *_Filename,
    ios_base::openmode _Mode = ios_base::in | ios_base::out,
    int _Prot = (int)ios_base::_Openprot
);
void open(
    const wchar_t *_Filename,
    ios_base::openmode _Mode
);

매개 변수

  • _Filename
    The name of the file to open.

  • _Mode
    One of the enumerations in ios_base::openmode.

  • _Prot
    The default file opening protection, equivalent to the shflag parameter in _fsopen, _wfsopen.

설명

The member function calls rdbuf -> open(_Filename, _Mode). If that function returns a null pointer, the function calls setstate(failbit).

예제

See basic_filebuf::open for an example of how to use open.

요구 사항

Header: <fstream>

네임스페이스: std

참고 항목

참조

basic_fstream 클래스

iostream 프로그래밍

iostreams 규칙