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
00051 inline int mkdirUserPermissions(const std::string& dirname)
00052 {
00053 #if !defined(_WIN32) && !defined(_MSC_VER) && !defined(__amigaos4__)
00054 return mkdir(dirname.c_str(), S_IRUSR | S_IWUSR | S_IXUSR);
00055 #elif defined(__amigaos4__)
00056
00057
00058 int ret = 0;
00059 ret = mkdir(dirname.c_str(), S_IRUSR | S_IWUSR | S_IXUSR);
00060 if (errno == EINVAL || errno == ENOTDIR)
00061 errno = EEXIST;
00062 return ret;
00063 #else
00064 return mkdir(dirname.c_str());
00065 #endif
00066 }
00067
00069
00071 DSOEXPORT bool mkdirRecursive(const std::string& filename);
00072
00073 }
00074
00075 #endif