CStdioFile类
来源:互联网 发布:数据库字段注释 编辑:程序博客网 时间:2024/04/30 19:49
参数内容:
第一个参数为路径+文件名,最后一个为错误出现的结构.
现在解释下第二个参数
CFile::modeCreate Directs the constructor to create a new file. If the file exists already, it is truncated to 0 length.
指定构造器创建一个新的文件,如果文件已经存在,则内容截0.
CFile::modeNoTruncate Combine this value with modeCreate. If the file being created already exists, it is not truncated to 0 length. Thus the file is guaranteed to open, either as a newly created file or as an existing file. This might be useful, for example, when opening a settings file that may or may not exist already. This option applies to CStdioFile as well.
modeNoTruncate
假如你不用这个参数的话,用modeCreate模式创建和打开一个文件,假如这个文件已经存在,则会清空这个已经存在的文件,加上modeNoTruncate的话,就不会清空这个文件了
CFile::modeRead Opens the file for reading only.
只是以读取方式打开
CFile::modeReadWrite Opens the file for reading and writing.
读与写同时
CFile::modeWrite Opens the file for writing only.
只写
CFile::modeNoInherit Prevents the file from being inherited by child processes.
阻止这个文件被子进程继承
CFile::shareDenyNone Opens the file without denying other processes read or write access to the file.Create fails if the file has been opened in compatibility mode by any other process.
打开这个文件同时允许其它进程读写这个文件。如果文件被其它进程以incompatibility模式打开,这是create操作会失败。
CFile::shareDenyRead Opens the file and denies other processes read access to the file. Create fails if the file has been opened in compatibility mode or for read access by any other process.
打开文件拒绝其它任何进程读这个文件。如果文件被其它进程用compatibility模式或者是读方式打开,create操作失败。
CFile::shareDenyWrite Opens the file and denies other processes write access to the file. Create fails if the file has been opened in compatibility mode or for write access by any other process.
打开文件拒绝其它任何进程写这个文件。如果文件被其它进程用compatibility模式或者是写方式打开,create操作失败。
CFile::shareExclusive Opens the file with exclusive mode, denying other processes both read and write access to the file. Construction fails if the file has been opened in any other mode for read or write access, even by the current process.
以独占方式打开这个文件,不允许其它进程读写这个文件。
CFile::shareCompat This flag is not available in 32 bit MFC. This flag maps to CFile::shareExclusivewhen used in CFile::Open.
这个标志在32位的MFC中无效。
CFile::typeText Sets text mode with special processing for carriage return–linefeed pairs (used in derived classes only).
CFile::typeText 设置成对回车换行对有特殊处理的文本模式(仅用在派生类中)
CFile::typeBinary 设置二进制模式(仅用在派生类中)
CStdioFile继承自CFile,一个CStdioFile 对象代表一个用运行时函数fopen 打开的C 运行时流文件。
- CStdioFile类
- CStdioFile类
- CStdioFile类
- CStdioFile类
- CStdioFile类
- CStdioFile类学习
- CStdioFile类学习笔记
- CStdioFile类学习笔记
- CStdioFile类学习笔记
- CStdioFile类学习
- MFC -- CStdioFile类
- CStdioFile类学习笔记
- Cstdiofile类详解
- CStdioFile
- CStdioFile
- CStdioFile
- CStdioFile
- CStdioFile
- c++基础---C++之运算符重载
- rpm删除软件的深入用法 比如强制删除 .
- 中国计算50年
- c字符串结尾多种操作方式
- 相隔日期有多少天多少时
- CStdioFile类
- hibernate初始化
- DB2 SQL自学笔记
- 自己电脑做服务器续,用默认端口,自动跳转到默认项目 【直接用域名访问我们本机的项目】
- poj 1742 Coins (背包)
- 视频快搜新片热剧,百度手机浏览器上都有啊
- Debug Assertion Failed! File:afxwin1.inl Line:22
- mybatis 对oracle和mysql 批量插入操作
- re模糊查询