summaryrefslogtreecommitdiff
path: root/src/lib/writer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-12 22:15:36 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-12 22:15:36 +0000
commit0a7004ab20d6bc3d20c1956df355384fa7f2da30 (patch)
tree0297fb4a4d3c80ecaf274f7447b987c6e982f0e4 /src/lib/writer.cc
parent2bde54c29e6b36c75948ca1d3efcda0535d148d7 (diff)
Try to copy instead of hard linking if the hard-link fails (#77).
Diffstat (limited to 'src/lib/writer.cc')
-rw-r--r--src/lib/writer.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 06acaa1f6..6ca56ec4e 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -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 */