file_stream::open_ostream 方法
開啟表示指定檔案的新輸出資料流。 如果檔案不存在,就會建立,除非所要尋找的資料夾或目錄也不存在。
static pplx::task<streams::basic_ostream<_CharType>> open_ostream(
const utility::string_t &file_name,
std::ios_base::openmode mode = std::ios_base::out,
#ifdef _MS_WINDOWS int prot = (int) std::ios_base::_Openprot #else int prot = 0 #endif
);
static pplx::task<streams::basic_ostream<_CharType>> open_ostream(
::Windows::Storage::StorageFile^ file,
std::ios_base::openmode mode = std::ios_base::out
);
參數
file_name
檔案名稱mode
檔案的開啟模式prot
檔案保護模式file
表示檔案的 StorageFile 參考
傳回值
task,其將傳回在完成時開啟的輸出資料流。
需求
**標頭:**filestream.h
**命名空間:**concurrency::streams