diff options
author | John Wiegley <johnw@newartisans.com> | 2008-08-14 02:15:11 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-08-14 02:15:11 -0400 |
commit | 6555f45c9d85a100614843c89d091240f70b3de6 (patch) | |
tree | 91268792fb2b5e358f20ddeb1cb447dabd6b1495 /src/session.h | |
parent | b07451d6500827a52684fda9fa6e729b79a4efc5 (diff) | |
download | fork-ledger-6555f45c9d85a100614843c89d091240f70b3de6.tar.gz fork-ledger-6555f45c9d85a100614843c89d091240f70b3de6.tar.bz2 fork-ledger-6555f45c9d85a100614843c89d091240f70b3de6.zip |
Moved a block of code from report to session, though it's still commented out.
Diffstat (limited to 'src/session.h')
-rw-r--r-- | src/session.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/session.h b/src/session.h index bd948bc8..5d8054d4 100644 --- a/src/session.h +++ b/src/session.h @@ -226,7 +226,21 @@ See LICENSE file included with the distribution for details and disclaimer.\n"; if (data_file.empty()) { data_file = args[0].as_string(); use_cache = false; + +#if 0 + // jww (2008-08-14): Should we check whether the file exists + // before we accept it, or is this done later on? + if (! data_file.string() == "-") { + std::string path = resolve_path(optarg); + if (access(path.c_str(), R_OK) != -1) + config->data_file = path; + else + throw_(std::invalid_argument, + "The ledger file '" << path << "' does not exist or is not readable"); + } +#endif } + return true; } }; |