From 0a7004ab20d6bc3d20c1956df355384fa7f2da30 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 12 Mar 2013 22:15:36 +0000 Subject: Try to copy instead of hard linking if the hard-link fails (#77). --- src/lib/writer.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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 */ -- cgit v1.2.3