Bitcointalk · auto backing up of wallet.dat

中本聪,2010 年 8 月 27 日

SN-2614 已核对来源,附原文与上下文。

阅读语言
中文译文

我怀疑 Windows 上并无 mmap(2)。我宁可调用现成的文件拷贝函数,也不想自己写一个再测试。

然而倘若你已然在用 boost::filesystem 的功能,直接用它里面的 copy_file 就行。我不过是觉得,若非为了别的用途已然引入了它,那有点杀鸡用牛刀。

谢谢。我原以为里面某处会有。

我们已然在十几个地方用了 boost::filesystem。这并非新增依赖。它给了我们大量可移植的东西,否则每个系统都得写 #ifdef,到处测试。

ORIGINAL · 英文原文
I doubt there's an mmap(2) on Windows.  I'd rather call an existing file copy function than make and test my own.

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.

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.
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-2614