Fix PBD::copy_file on windows to work with non-ascii paths
authorTim Mayberry <mojofunk@gmail.com>
Sun, 8 Mar 2015 12:38:52 +0000 (22:38 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Sun, 8 Mar 2015 12:46:26 +0000 (22:46 +1000)
This breakage was indicated by the filesystem unit tests.

libs/pbd/file_utils.cc

index a15cd04cd4f23f58f4277a3f878b4e7982a5bbf9..5a0ffa928fdc30ec759974c0b189ed16b30b37f7 100644 (file)
@@ -283,8 +283,8 @@ copy_file(const std::string & from_path, const std::string & to_path)
 {
        if (!Glib::file_test (from_path, Glib::FILE_TEST_EXISTS)) return false;
 
-       PBD::ScopedFileDescriptor fd_from (::open (from_path.c_str(), O_RDONLY));
-       PBD::ScopedFileDescriptor fd_to (::open (to_path.c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666));
+       PBD::ScopedFileDescriptor fd_from (g_open (from_path.c_str(), O_RDONLY, 0444));
+       PBD::ScopedFileDescriptor fd_to (g_open (to_path.c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666));
 
        char buf[4096]; // BUFSIZ  ??
        ssize_t nread;