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"
14 #include "support/FileName.h"
16 #ifdef HAVE_SYS_STAT_H
17 # include <sys/stat.h>
19 #ifdef HAVE_SYS_TYPES_H
20 # include <sys/types.h>
37 int mkdir(FileName const & pathname, unsigned long int mode)
39 // FIXME: why don't we have mode_t in lyx::mkdir prototype ??
41 # if MKDIR_TAKES_ONE_ARG
43 return ::mkdir(pathname.toFilesystemEncoding().c_str());
44 // FIXME: "Permissions of created directories are ignored on this system."
47 return ::mkdir(pathname.toFilesystemEncoding().c_str(), mode_t(mode));
51 return CreateDirectory(pathname.toFilesystemEncoding().c_str(), 0) != 0 ? 0 : -1;
52 // FIXME: "Permissions of created directories are ignored on this system."
54 return ::_mkdir(pathname.toFilesystemEncoding().c_str());
55 // FIXME: "Permissions of created directories are ignored on this system."
57 # error "Don't know how to create a directory on this system."
62 } // namespace support