diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-07 22:30:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-07 22:30:35 +0100 |
| commit | 8042a85601d75d8a69bf0a0d1b00fcdbced252b4 (patch) | |
| tree | 0c59b509b3a263a8ae49551a8595fbbaefec594b /src | |
| parent | 3750513dd20e5b3db14a825fb566f15fb434f85d (diff) | |
Create film directory in constructor.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/film.cc | 8 |
1 files 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 (); |
