3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
13 #include "support/lyxlib.h"
15 #ifdef HAVE_SYS_STAT_H
16 # include <sys/stat.h>
18 #ifdef HAVE_SYS_TYPES_H
19 # include <sys/types.h>
32 int lyx::support::mkdir(std::string const & pathname, unsigned long int mode)
34 // FIXME: why don't we have mode_t in lyx::mkdir prototype ??
36 # if MKDIR_TAKES_ONE_ARG
38 return ::mkdir(pathname.c_str());
41 return ::mkdir(pathname.c_str(), mode_t(mode));
45 return CreateDirectory(pathname.c_str(), 0) != 0 ? 0 : -1;
47 return ::_mkdir(pathname.c_str());
49 # error "Don't know how to create a directory on this system."