# # patch "ChangeLog" # from [2bad97578e3bf8ba92213fb7c2164d24e5d092c2] # to [1716e98aad837a5efe621de77a777c60e51e45b2] # # patch "file_io.cc" # from [08ce2fc2b87b2852f9b67a80af939955984de018] # to [35b0d27bb9a0a1c72b651fd2081a0f9a6d6c58f1] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,8 @@ +2005-05-12 Matthew Gregan + + * file_io.cc (write_data_impl): Use portable boost::filesystem + calls in place of unlink(2)/remove(2). + 2005-05-11 Nathaniel Smith * std_hooks.lua (ignore_file): Organize a bit more, add --- file_io.cc +++ file_io.cc @@ -1,10 +1,8 @@ // copyright (C) 2002, 2003 graydon hoare // all rights reserved. // licensed to the public under the terms of the GNU GPL (>= 2) // see the file COPYING for details -#include // for rename(2) - #include #include #include @@ -509,12 +507,10 @@ // data.tmp closes } - // god forgive my portability sins if (fs::exists(p)) - N(unlink(p.string().c_str()) == 0, - F("unlinking %s failed") % p.string()); - N(rename(tmp.string().c_str(), p.string().c_str()) == 0, - F("rename of %s to %s failed") % tmp.string() % p.string()); + N(fs::remove(p), + F("removing %s failed") % p.string()); + fs::rename(tmp, p); } void