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());
45 # warning "Permissions of created directories are ignored on this system."
49 return ::mkdir(pathname.toFilesystemEncoding().c_str(), mode_t(mode));
53 return CreateDirectory(pathname.toFilesystemEncoding().c_str(), 0) != 0 ? 0 : -1;
55 # warning "Permissions of created directories are ignored on this system."
58 return ::_mkdir(pathname.toFilesystemEncoding().c_str());
60 # warning "Permissions of created directories are ignored on this system."
63 # error "Don't know how to create a directory on this system."
68 } // namespace support