本文簡要介紹rust語言中 std::os::windows::fs::OpenOptionsExt.custom_flags
的用法。
用法
fn custom_flags(&mut self, flags: u32) -> &mut Self
將調用 CreateFile2
的 dwFileFlags
參數的額外標誌設置為指定值(或將其與 attributes
和 security_qos_flags
組合以設置 dwFlagsAndAttributes
的 CreateFile
)。
自定義標誌隻能設置標誌,不能刪除 Rust 選項設置的標誌。此選項會覆蓋任何先前設置的自定義標誌。
例子
extern crate winapi;
use std::fs::OpenOptions;
use std::os::windows::prelude::*;
let file = OpenOptions::new()
.create(true)
.write(true)
.custom_flags(winapi::FILE_FLAG_DELETE_ON_CLOSE)
.open("foo.txt");
相關用法
- Rust OpenOptionsExt.custom_flags用法及代碼示例
- Rust OpenOptionsExt.access_mode用法及代碼示例
- Rust OpenOptionsExt.security_qos_flags用法及代碼示例
- Rust OpenOptionsExt.mode用法及代碼示例
- Rust OpenOptionsExt.share_mode用法及代碼示例
- Rust OpenOptionsExt.attributes用法及代碼示例
- Rust OpenOptions.append用法及代碼示例
- Rust OpenOptions.new用法及代碼示例
- Rust OpenOptions.create用法及代碼示例
- Rust OpenOptions.write用法及代碼示例
- Rust OpenOptions用法及代碼示例
- Rust OpenOptions.open用法及代碼示例
- Rust OpenOptions.create_new用法及代碼示例
- Rust OpenOptions.truncate用法及代碼示例
- Rust OpenOptions.read用法及代碼示例
- Rust Option.unwrap_or_default用法及代碼示例
- Rust Option.as_deref_mut用法及代碼示例
- Rust Option.get_or_insert_with用法及代碼示例
- Rust Option.iter_mut用法及代碼示例
- Rust Option.or_else用法及代碼示例
- Rust Option.unwrap_unchecked用法及代碼示例
- Rust Option.get_or_insert用法及代碼示例
- Rust Option.expect用法及代碼示例
- Rust Option.get_or_insert_default用法及代碼示例
- Rust Option.insert用法及代碼示例
注:本文由純淨天空篩選整理自rust-lang.org大神的英文原創作品 std::os::windows::fs::OpenOptionsExt.custom_flags。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。