diff --git a/src/FileOps.cpp b/src/FileOps.cpp index 5676afa..28255ef 100644 --- a/src/FileOps.cpp +++ b/src/FileOps.cpp @@ -3,6 +3,9 @@ #include "Platform.h" #include "StringUtils.h" +#include +#include + #ifdef PLATFORM_UNIX #include #include @@ -10,6 +13,7 @@ #include #include #include +#include #endif FileOps::IOException::~IOException() throw () @@ -125,7 +129,10 @@ void FileOps::removeFile(const char* src) throw (IOException) std::string FileOps::dirname(const char* path) { #ifdef PLATFORM_UNIX - throw IOException("not implemented"); + char* pathCopy = strdup(path); + std::string dirname = ::dirname(pathCopy); + free(pathCopy); + return dirname; #else throw IOException("not implemented"); #endif