linux环境下读写超过2G的大文件 分类: 工作笔记 2006-08-25 20:51 1033人阅读 评论(0) 收藏 举报 linux默认环境下打开、读、写超过2G的文件会返回错误。 定义如下宏可以突破这个限制,对read/write和fread/fwrite同时有效。 注意它必须定义在所有头文件之前。 #define _FILE_OFFSET_BITS 64 #include < stdio.h > #include < stdlib.h > #include < sys / types.h > #include < sys / stat.h > #include < fcntl.h > #include < unistd.h > 分享到: