From 16d844090f6c3fecda233ed7399e328b78822541 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 8 Jun 2006 11:22:45 +0000 Subject: [PATCH] From Joan Abadie: patch fixes : "osgDB::makeDirectory doesn't work on win32 when using full path name like : "d:/demo" it tryes a mkdir("d:")." --- src/osgDB/FileUtils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index 3ea6eb3a1..f4f5d3657 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -107,6 +107,14 @@ bool osgDB::makeDirectory( const std::string &path ) { std::string dir = paths.top(); + #if defined(WIN32) + //catch drive name + if (dir.size() == 2 && dir.c_str()[1] == ':') { + paths.pop(); + continue; + } + #endif + if( mkdir( dir.c_str(), 0755 )< 0 ) { osg::notify(osg::DEBUG_INFO) << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;