Re: [問題] 如何用 fopen相關函式操作大檔案 ?

看板Linux作者時間15年前 (2010/11/28 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
Linux藍海帝國 <jeremy007.bbs@ptt.cc> wrote: > 小弟在 linux i686 平台上撰寫存取檔案的程式 > 遇到一個大檔案, 使用已知的 fopen 等相關標準函式庫, 發現無法正常操作 > 此檔案的大小超過 10 GB > 對於小於 4 GB 的檔案, 小弟習慣用 fopen/fseek/fread 等標準函式存取 > 對於大檔案, 有沒有對應的存取函式, 或是程式撰寫方式呢 ? On many architectures both off_t and long are 32-bit types, but compilation with #define _FILE_OFFSET_BITS 64 will turn off_t into a 64-bit type.
文章代碼(AID): #1CyKTVjf (Linux)