]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/file.h
Add an exclusive create flag to IO::File
[libs/core.git] / source / io / file.h
index 430571f909d872854e64d11ac43917442541f121..4f8e5ddf8612b559f82ce5bfc7c2623ba5860cc9 100644 (file)
@@ -17,6 +17,12 @@ public:
        file_not_found(const std::string &fn): std::runtime_error(fn) { }
 };
 
+class file_already_exists: public std::runtime_error
+{
+public:
+       file_already_exists(const std::string &fn): std::runtime_error(fn) { }
+};
+
 
 /**
 A class for reading and writing files.
@@ -30,7 +36,8 @@ public:
        {
                C_NONE = 0,
                C_CREATE = 1,
-               C_TRUNCATE = 2
+               C_TRUNCATE = 2,
+               C_EXCLUSIVE = 4
        };
 
 private: