Tag: 大文件支持

如何移植大文件支持?

我目前正在编写一个C程序,用于读取和写入大小超过2 GiB的文件。 在linux上, feature_test_macros (7)指定: _LARGEFILE64_SOURCE Expose definitions for the alternative API specified by the LFS (Large File Summit) as a “tran‐ sitional extension” to the Single UNIX Specification. (See ⟨http://opengroup.org/platform /lfs.html⟩) The alternative API consists of a set of new objects (ie, functions and types) whose names are suffixed with “64” (eg, off64_t versus […]

O_LARGEFILE只需要写一个大文件吗?

如果我想要做的就是写一个大文件( O_WRONLY )或附加到一个大文件( O_APPEND | O_WRONLY ),是否需要O_LARGEFILE标志? 从我在CLucene-dev邮件列表上读到的标题为“ 无法写入> 2gb 索引文件 ”的post中,可能需要O_LARGEFILE来编写大文件,但该讨论中的参与者使用的是O_RDWR ,而不是O_WRONLY ,所以我是不确定。