“打开”是否有任何基于文件大小的限制。 ? 我的文件大小是 2 GB,它会成功打开吗?是否会出现任何时间问题? 文件系统是 rootfs。
最佳答案
来自 open
手册页:
O_LARGEFILE
(LFS) Allow files whose sizes cannot be represented in an
off_t
(but can be represented in anoff64_t
) to be opened. The_LARGEFILE64_SOURCE
macro must be defined in order to obtain this definition. Setting the_FILE_OFFSET_BITS
feature test macro to 64 (rather than usingO_LARGEFILE
) is the preferred method of obtaining method of accessing large files on 32-bit systems (seefeature_test_macros
(7)).
在 64 位系统上,off_t
将是 64 位,您不会有任何问题。在 32 位系统上,您将需要建议的解决方法以允许大于 2 GB 的文件。
关于linux - 基于文件大小的打开限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3254796/