Open()

File::Open(const String&, FileMode) method

Opens the specified file in the specified mode for reading and writing and with no sharing.

static FileStreamPtr System::IO::File::Open(const String &path, FileMode mode)

Arguments

ParameterTypeDescription
pathconst String&The path of the file to open
modeFileModeSpecifies the mode in which to open the file

Return Value

A FileStream object associated with the opened file

File::Open(const String&, FileMode, FileAccess, FileShare) method

Opens the specified file in the specified mode, with the specified access type and sharing option.

static FileStreamPtr System::IO::File::Open(const String &path, FileMode mode, FileAccess access, FileShare share=FileShare::None)

Arguments

ParameterTypeDescription
pathconst String&The path of the file to open
modeFileModeSpecifies the mode in which to open the file
accessFileAccessThe requested access type
shareFileShareThe type of access that other FileStream objects have to the opened file

Return Value

A FileStream object associated with the opened file

See Also