Open函数——详解
来源:互联网 发布:ipad进入淘宝卖家中心 编辑:程序博客网 时间:2024/06/07 06:20
Open函数的函数原型如下:
gcc:
_CRTIMP int __cdecl _open (const char*, int, ...);
VC6.0:
_CRTIMP int __cdecl _open(const char *, int, ...);
Borland C++Builder:
int _RTLENTRY _EXPFUNC open(const char _FAR *__path, int __access,... /*unsigned mode*/);
tc3.1:
int _Cdecl _FARFUNC open(const char _FAR *__path, int __access,... /*unsigned mode*/);
tc2.0:
int _Cdecl open (const char *path, int access,... /*unsigned mode*/);
其中 access的取值有:
#define O_RDONLY 1
#define O_WRONLY 2
#define O_RDWR 4
access还可以是以下flag及它们之间的组合而得到的性质:
#define O_CREAT 0x0100 /* create and open file */
#define O_TRUNC 0x0200 /* open with truncation */
#define O_EXCL 0x0400 /* exclusive open */
#define O_APPEND 0x0800 /* to end of file */
#define O_CHANGED 0x1000 /* user may read these bits, but */
#define O_DEVICE 0x2000 /* only RTL/io functions may touch. */
#define O_TEXT 0x4000 /* CR-LF translation */
#define O_BINARY 0x8000 /* no translation */
mode 参数仅在access取值为O_CREAT时有效。
对于大文件的支持
在WIN32机器:
_lseeki64 _telli64
在Linux上:
#define _FILE_OFFSET_BITS 64
fp = open(filename, O_RDONLY | O_LARGEFILE);
lseek64
- Open函数——详解
- Window.open函数详解
- open()—打开文件函数
- C语言OPEN函数详解
- C语言OPEN函数详解
- C语言OPEN函数详解
- Linux中open函数详解
- Linux中open函数详解
- C语言OPEN函数详解
- C语言OPEN函数详解
- Python之open()函数详解
- Linux中open函数详解
- open函数的flag详解
- open函数mode参数详解
- Linux--open函数使用详解
- 文件 I/O——open函数
- linux下c —open函数
- linux下c —open函数
- 网络文件系统nfs的配置(看我写的跟真的似的!)
- signal处理机制
- Thinkphp 2.0 整合fck编辑器
- Java基础3_面向对象上
- java.io.File中的 pathSeparator 与separator 的区别
- Open函数——详解
- 从"头"开始学html
- 提高PHP编程效率的53个要点
- 哎 不容易啊
- 《window》核心编程第五版 小结
- ORA-19809: limit exceeded for recovery files
- backup
- batch home
- ECMAScript基础之三(第二章)