Write large file

前端 未结 3 2460
青春惊慌失措
青春惊慌失措 2021-02-20 08:39

I try to write to a large file, but it seems like it does not work for files larger than 2GB. I have tried with boost::iostreams::file_sink. Is this just a limit with the boost

3条回答
  •  清歌不尽
    2021-02-20 09:05

    In Win32/64 the ReadFile & WriteFile can write files larger than 4gb. The positioning is done via a 64bit _LARGE_INTEGER value in SetFilePointerEx. Likewise to get the file size you need GetFileSizeEx and not the basic GetFileSize.

提交回复
热议问题