Fix a number of missing fopen_boost replacements; might fix problems with adding...
authorCarl Hetherington <cth@carlh.net>
Sun, 29 Dec 2013 00:16:22 +0000 (00:16 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 29 Dec 2013 00:16:22 +0000 (00:16 +0000)
src/lib/cross.cc
src/lib/dcp_video_frame.cc
src/lib/file_group.cc
src/lib/scp_dcp_job.cc
src/lib/writer.cc

index 7436dbf26a9b4582edcfb8e1702638b2e91d3416..746b4f509c7e010a7c0203eda85bc155239af779 100644 (file)
@@ -187,7 +187,7 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share
                return;
        }
 
-       FILE* o = fopen (out.string().c_str(), "w");
+       FILE* o = fopen_boost (out, "w");
        if (!o) {
                log->log ("ffprobe call failed (could not create output file)");
                return;
index 685e24d63bd5cf40db8401475f548a4031569b09..78d73ad00c0a035d9156059e29de9e5c8ab4b093 100644 (file)
@@ -352,7 +352,7 @@ EncodedData::EncodedData (boost::filesystem::path file)
        _size = boost::filesystem::file_size (file);
        _data = new uint8_t[_size];
 
-       FILE* f = fopen (file.string().c_str(), N_("rb"));
+       FILE* f = fopen_boost (file, "rb");
        if (!f) {
                throw FileError (_("could not open file for reading"), file);
        }
@@ -381,7 +381,7 @@ EncodedData::write (shared_ptr<const Film> film, int frame, Eyes eyes) const
 {
        boost::filesystem::path const tmp_j2c = film->j2c_path (frame, eyes, true);
 
-       FILE* f = fopen (tmp_j2c.string().c_str (), N_("wb"));
+       FILE* f = fopen_boost (tmp_j2c, "wb");
        
        if (!f) {
                throw WriteFileError (tmp_j2c, errno);
index 9c206514152acc077d84419a4afafe846283c4e3..dfe336b8f87eae4a9a568251aa8c735316acb61f 100644 (file)
@@ -21,6 +21,7 @@
 #include <sndfile.h>
 #include "file_group.h"
 #include "exceptions.h"
+#include "cross.h"
 
 using std::vector;
 using std::cout;
@@ -78,7 +79,7 @@ FileGroup::ensure_open_path (size_t p) const
        }
 
        _current_path = p;
-       _current_file = fopen (_paths[_current_path].string().c_str(), "rb");
+       _current_file = fopen_boost (_paths[_current_path], "rb");
        if (_current_file == 0) {
                throw OpenFileError (_paths[_current_path]);
        }
index 779c8dd44b2abf131ea8490c73c4f17f8b155ef1..e367c9fe8f1ef3a7017e5e6fde8f78784892d006 100644 (file)
@@ -170,7 +170,7 @@ SCPDCPJob::run ()
                boost::uintmax_t to_do = boost::filesystem::file_size (*i);
                ssh_scp_push_file (sc.scp, leaf.c_str(), to_do, S_IRUSR | S_IWUSR);
 
-               FILE* f = fopen (boost::filesystem::path (*i).string().c_str(), N_("rb"));
+               FILE* f = fopen_boost (boost::filesystem::path (*i), "rb");
                if (f == 0) {
                        throw NetworkError (String::compose (_("Could not open %1 to send"), *i));
                }
index 109447f73de527a7e57a95cef905893bb6e58ceb..4129b7a824455ffc8138cf0a8a6e0ccc638920b9 100644 (file)
@@ -478,7 +478,7 @@ Writer::check_existing_picture_mxf ()
        boost::filesystem::path p;
        p /= _film->internal_video_mxf_dir ();
        p /= _film->internal_video_mxf_filename ();
-       FILE* mxf = fopen (p.string().c_str(), "rb");
+       FILE* mxf = fopen_boost (p, "rb");
        if (!mxf) {
                _film->log()->log (String::compose ("Could not open existing MXF at %1 (errno=%2)", p.string(), errno));
                return;