- More file conversions.
This commit is contained in:
Paul Beckingham
2011-06-11 14:57:11 -04:00
parent 63e6c08fdd
commit 76b30d8d10
11 changed files with 66 additions and 39 deletions

View File

@@ -25,13 +25,17 @@
//
////////////////////////////////////////////////////////////////////////////////
#define L10N // Localization complete.
#include <fstream>
#include <sys/types.h>
#include <sys/file.h>
#include <pwd.h>
#include <unistd.h>
#include <File.h>
#include <text.h>
#include <util.h>
#include <i18n.h>
////////////////////////////////////////////////////////////////////////////////
File::File ()
@@ -107,8 +111,7 @@ bool File::open ()
bool already_exists = exists ();
if (already_exists)
if (!readable () || !writable ())
throw std::string ("Task does not have the correct permissions for '") +
data + "'.";
throw std::string (format (STRING_FILE_PERMS, data));
fh = fopen (data.c_str (), (already_exists ? "r+" : "w+"));
if (fh)