Code: Select all
Index: include/IFileSystem.h
===================================================================
--- include/IFileSystem.h (Revision 2143)
+++ include/IFileSystem.h (Arbeitskopie)
@@ -212,6 +212,11 @@
If you no longer need the object, you should call IAttributes::drop().
See IReferenceCounted::drop() for more information. */
virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) = 0;
+
+ //! Creates a new directory in the current working dir
+ /** \param dirname: Name of the directory that should be created
+ \return Returns true if the directory was created, and false if an error occured */
+ virtual bool createDir( const c8* dirname ) const = 0;
};
} // end namespace io
Index: source/Irrlicht/CFileSystem.cpp
===================================================================
--- source/Irrlicht/CFileSystem.cpp (Revision 2143)
+++ source/Irrlicht/CFileSystem.cpp (Arbeitskopie)
@@ -404,7 +404,23 @@
return new CAttributes(driver);
}
+//! Creates a new directory in the current working dir
+bool CFileSystem::createDir( const c8* dirname ) const
+{
+#ifdef _IRR_WINDOWS_API_
+ if( _mkdir( dirname ) != 0)
+#else
+ if( mkdir( dirname, 777 ) != 0 )
+#endif
+ {
+ _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
+ return false;
+ }
+
+ return true;
+}
+
} // end namespace irr
} // end namespace io
Index: source/Irrlicht/CFileSystem.h
===================================================================
--- source/Irrlicht/CFileSystem.h (Revision 2143)
+++ source/Irrlicht/CFileSystem.h (Arbeitskopie)
@@ -103,6 +103,9 @@
//! Creates a new empty collection of attributes, usable for serialization and more.
virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver);
+
+ //! Creates a new directory in the current working dir
+ virtual bool createDir( const c8* dirname ) const;
private: