|
|
@ -54,18 +54,18 @@ bool DFHack::Filesystem::chdir (std::string path)
|
|
|
|
return !(bool)::chdir(path.c_str());
|
|
|
|
return !(bool)::chdir(path.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char * DFHack::Filesystem::getcwd ()
|
|
|
|
std::string DFHack::Filesystem::getcwd ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char *path;
|
|
|
|
char *path;
|
|
|
|
char buf[LFS_MAXPATHLEN];
|
|
|
|
char buf[LFS_MAXPATHLEN];
|
|
|
|
|
|
|
|
std::string result = "";
|
|
|
|
#ifdef _WIN32
|
|
|
|
#ifdef _WIN32
|
|
|
|
if ((path = ::_getcwd(buf, LFS_MAXPATHLEN)) == NULL)
|
|
|
|
if ((path = ::_getcwd(buf, LFS_MAXPATHLEN)) != NULL)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
if ((path = ::getcwd(buf, LFS_MAXPATHLEN)) == NULL)
|
|
|
|
if ((path = ::getcwd(buf, LFS_MAXPATHLEN)) != NULL)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
return NULL;
|
|
|
|
result = buf;
|
|
|
|
else
|
|
|
|
return result;
|
|
|
|
return path;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool DFHack::Filesystem::mkdir (std::string path)
|
|
|
|
bool DFHack::Filesystem::mkdir (std::string path)
|
|
|
|