From 8042a85601d75d8a69bf0a0d1b00fcdbced252b4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 7 Oct 2012 22:30:35 +0100 Subject: [PATCH] Create film directory in constructor. --- src/lib/film.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/film.cc b/src/lib/film.cc index 2db03f6a6..20edacf59 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -85,8 +85,12 @@ Film::Film (string d, bool must_exist) _state.directory = result.string (); - if (must_exist && !filesystem::exists (_state.directory)) { - throw OpenFileError (_state.directory); + if (!filesystem::exists (_state.directory)) { + if (must_exist) { + throw OpenFileError (_state.directory); + } else { + filesystem::create_directory (_state.directory); + } } read_metadata (); -- 2.30.2