Try to copy instead of hard linking if the hard-link fails (#77).
authorCarl Hetherington <cth@carlh.net>
Tue, 12 Mar 2013 22:15:36 +0000 (22:15 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 12 Mar 2013 22:15:36 +0000 (22:15 +0000)
src/lib/writer.cc

index 06acaa1f63109162c53521a55c513396f2096e39..6ca56ec4e743e7c175111e778c3916e4ff98b5ac 100644 (file)
@@ -273,8 +273,12 @@ Writer::finish ()
        boost::filesystem::path to;
        to /= _film->dir (_film->dcp_name());
        to /= N_("video.mxf");
-       
-       boost::filesystem::create_hard_link (from, to);
+
+       boost::system::error_code ec;
+       if (boost::filesystem::create_hard_link (from, to, ec)) {
+               /* hard link failed; copy instead */
+               boost::filesystem::copy_file (from, to);
+       }
 
        /* And update the asset */