SN-2614 已核对来源,附原文与上下文。
我怀疑 Windows 上没有 mmap(2)。我宁可调用现成的文件拷贝函数,也不想自己写一个再测试。
I doubt there's an mmap(2) on Windows. I'd rather call an existing file copy function than make and test my own.
其他参与者原话nelisky原帖 ↗但如果你已经在用 boost::filesystem 的功能,直接用它里面的 copy_file 就行。我只是觉得,如果不是为了别的用途已经引入了它,那有点杀鸡用牛刀。
But if you are already using features from boost::filesystem you can use copy_file from that. I just think that, if not already required for something else, it's a tad overkill.
谢谢。我原以为里面某处会有。
Thanks. I thought it would be in there somewhere.
我们已经在十几个地方用了 boost::filesystem。这并非新增依赖。它给了我们大量可移植的东西,否则每个系统都得写 #ifdef,到处测试。
We already use boost::filesystem in a dozen places. It's not a new added dependency. It gives us a lot of portable stuff that we would otherwise have to have a #ifdef for each OS and test everywhere.