Share via


file_stream::open_istream Method

Open a new input stream representing the given file. The file should already exist on disk, or an exception will be thrown.

static pplx::task<streams::basic_istream<_CharType>> open_istream(
   const utility::string_t &file_name,
   std::ios_base::openmode mode = std::ios_base::in,
   #ifdef _MS_WINDOWS int prot = (int) std::ios_base::_Openprot #else int prot = 0 #endif
);

static pplx::task<streams::basic_istream<_CharType>> open_istream(
   ::Windows::Storage::StorageFile^ file,
   std::ios_base::openmode mode = std::ios_base::in
);

Parameters

  • file_name
    The name of the file

  • mode
    The opening mode of the file

  • prot
    The file protection mode

  • file
    The StorageFile reference representing the file

Return Value

A task that returns an opened input stream on completion.

Requirements

Header: filestream.h

Namespace: concurrency::streams

See Also

Reference

file_stream Class