]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/stat.cpp
Exception rework for fs components
[libs/core.git] / source / fs / stat.cpp
index 1dc46db78289dce316ffb36bee60b3a9539066e2..ccd344b875e809ecdbf3016e96d4576ab0c898dc 100644 (file)
@@ -1,15 +1,7 @@
-/* $Id$
-
-This file is part of libmspfs
-Copyright © 2006-2008  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include <cerrno>
 #ifdef WIN32
 #include <io.h>
 #endif
-#include <msp/core/except.h>
+#include <msp/core/systemerror.h>
 #include "path.h"
 #include "stat.h"
 
@@ -25,7 +17,7 @@ struct stat stat(const Path &fn)
 {
        struct stat st;
        if(stat(fn, st)==-1)
-               throw SystemError("stat failed", errno);
+               throw system_error("stat");
        return st;
 }
 
@@ -42,7 +34,7 @@ struct stat lstat(const Path &fn)
 {
        struct stat st;
        if(lstat(fn, st)==-1)
-               throw SystemError("lstat failed", errno);
+               throw system_error("lstat");
        return st;
 }