to get a more accurate error number on Windows.
auto file = dcp::File(_paths[_current_path], "rb");
if (!file) {
- throw OpenFileError(_paths[_current_path], errno, OpenFileError::READ);
+ throw OpenFileError(_paths[_current_path], file.open_error(), OpenFileError::READ);
}
_current_path = p;
, _file(path, read ? "rb" : (dcp::filesystem::exists(path) ? "r+b" : "wb"))
{
if (!_file) {
- throw OpenFileError(path, errno, read ? OpenFileError::READ : (dcp::filesystem::exists(path) ? OpenFileError::READ_WRITE : OpenFileError::WRITE));
+ throw OpenFileError(path, _file.open_error(), read ? OpenFileError::READ : (dcp::filesystem::exists(path) ? OpenFileError::READ_WRITE : OpenFileError::WRITE));
}
}
if (ext == ".stl") {
dcp::File f(content->path(0), "rb");
if (!f) {
- throw OpenFileError (f.path(), errno, OpenFileError::READ);
+ throw OpenFileError(f.path(), f.open_error(), OpenFileError::READ);
}
try {
reader.reset(new sub::STLBinaryReader(f.get()));
while (i < int64_t (files.size()) && to_do > 0) {
dcp::File f(files[i], "rb");
if (!f) {
- throw OpenFileError (files[i].string(), errno, OpenFileError::READ);
+ throw OpenFileError(files[i].string(), f.open_error(), OpenFileError::READ);
}
auto this_time = min(to_do, dcp::filesystem::file_size(files[i]));
while (i >= 0 && to_do > 0) {
dcp::File f(files[i], "rb");
if (!f) {
- throw OpenFileError (files[i].string(), errno, OpenFileError::READ);
+ throw OpenFileError(files[i].string(), f.open_error(), OpenFileError::READ);
}
auto this_time = min(to_do, dcp::filesystem::file_size(files[i]));
{
dcp::File f(from, "rb");
if (!f) {
- throw OpenFileError (from, errno, OpenFileError::READ);
+ throw OpenFileError(from, f.open_error(), OpenFileError::READ);
}
dcp::File t(to, "wb");
if (!t) {
- throw OpenFileError (to, errno, OpenFileError::WRITE);
+ throw OpenFileError(to, t.open_error(), OpenFileError::WRITE);
}
/* on the order of a second's worth of copying */
auto const cover = film()->file("COVER_SHEET.txt");
dcp::File file(cover, "w");
if (!file) {
- throw OpenFileError (cover, errno, OpenFileError::WRITE);
+ throw OpenFileError(cover, file.open_error(), OpenFileError::WRITE);
}
auto text = Config::instance()->cover_sheet ();
}
dcp::File f(path, "w");
if (!f) {
- throw OpenFileError(path, errno, OpenFileError::WRITE);
+ throw OpenFileError(path, f.open_error(), OpenFileError::WRITE);
}
string const s = j->certificate(true);
}
dcp::File f(path, "w");
if (!f) {
- throw OpenFileError(path, errno, OpenFileError::WRITE);
+ throw OpenFileError(path, f.open_error(), OpenFileError::WRITE);
}
auto const s = _get()->chain();
}
dcp::File f(path, "w");
if (!f) {
- throw OpenFileError (path, errno, OpenFileError::WRITE);
+ throw OpenFileError(path, f.open_error(), OpenFileError::WRITE);
}
auto const s = _get()->key().get ();
boost::filesystem::path path(wx_to_std(d->GetPath()));
dcp::File f(path, "w");
if (!f) {
- throw OpenFileError(path, errno, OpenFileError::WRITE);
+ throw OpenFileError(path, f.open_error(), OpenFileError::WRITE);
}
auto const chain = Config::instance()->decryption_chain()->chain();
dcp::File f(wx_to_std(d->GetPath()), "r");
if (!f) {
- throw OpenFileError(f.path(), errno, OpenFileError::WRITE);
+ throw OpenFileError(f.path(), f.open_error(), OpenFileError::WRITE);
}
string current;
}
dcp::File f(path, "w");
if (!f) {
- throw OpenFileError(path, errno, OpenFileError::WRITE);
+ throw OpenFileError(path, f.open_error(), OpenFileError::WRITE);
}
auto const s = Config::instance()->decryption_chain()->leaf().certificate (true);