Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00022
00028 #ifndef GNASH_FILE_UTILITIES_H
00029 #define GNASH_FILE_UTILITIES_H
00030
00031 #include "dsodefs.h"
00032
00033 #if !defined(_MSC_VER)
00034 # include <unistd.h>
00035 # include <sys/stat.h>
00036 # include <sys/types.h>
00037 # include <dirent.h>
00038 # include <cerrno>
00039 #else
00040 #include <io.h>
00041 #define dup _dup
00042 #endif
00043
00044 #include <string>
00045
00046 namespace gnash {
00047
00049
00055 inline int mkdirUserPermissions(const std::string& dirname)
00056 {
00057 #if !defined(_WIN32) && !defined(_MSC_VER) && !defined(__amigaos4__)
00058 return mkdir(dirname.c_str(), S_IRUSR | S_IWUSR | S_IXUSR);
00059 #elif defined(__amigaos4__)
00060
00061
00062 int ret = 0;
00063 ret = mkdir(dirname.c_str(), S_IRUSR | S_IWUSR | S_IXUSR);
00064 if (errno == EINVAL || errno == ENOTDIR)
00065 errno = EEXIST;
00066 return ret;
00067 #else
00068 return mkdir(dirname.c_str());
00069 #endif
00070 }
00071
00073
00079 DSOEXPORT bool mkdirRecursive(const std::string& filename);
00080
00081 }
00082
00083 #endif