Write large file

前端 未结 3 2419
青春惊慌失措
青春惊慌失措 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 08:57

    This depends on:

    • The file system which you're using. Old file systems like FAT allow only files up to 2GB. Use NTFS.
    • Your library must be compiled to allow large files (64bit seek offsets). If they use 32bit ints to seek in file (check the arguments and results of the calls "seek" and "tell"), you can only ever access 2GB (2^31bits, the 32th is the sign +/-)

    This might also help: http://www.boost.org/doc/libs/1_37_0/libs/iostreams/doc/faq.html#offsets

提交回复
热议问题