Remove POSIX mkdir wrapper

Unused by now, use `<filesystem>` instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2026-06-17 19:06:00 +02:00
parent ca3bacf6c1
commit 792949e812
3 changed files with 0 additions and 43 deletions
-7
View File
@@ -55,11 +55,4 @@ extern int wopen(const OsPath& pathname, int oflag);
extern int wopen(const OsPath& pathname, int oflag, mode_t mode);
extern int wclose(int fd);
//
// sys/stat.h
//
int wmkdir(const OsPath& path, mode_t mode);
#endif // #ifndef INCLUDED_SYSDEP_FILESYSTEM
@@ -97,8 +97,3 @@ int wrename(const OsPath& pathnameOld, const OsPath& pathnameNew)
{
return rename(OsString(pathnameOld).c_str(), OsString(pathnameNew).c_str());
}
int wmkdir(const OsPath& path, mode_t mode)
{
return mkdir(OsString(path).c_str(), mode);
}
@@ -129,34 +129,3 @@ int wclose(int fd)
return _close(fd);
return 0;
}
static int ErrnoFromCreateDirectory()
{
switch(GetLastError())
{
case ERROR_ALREADY_EXISTS:
return EEXIST;
case ERROR_PATH_NOT_FOUND:
return ENOENT;
case ERROR_ACCESS_DENIED:
return EACCES;
case ERROR_WRITE_PROTECT:
return EROFS;
case ERROR_DIRECTORY:
return ENOTDIR;
default:
return 0;
}
}
int wmkdir(const OsPath& path, mode_t)
{
if(!CreateDirectoryW(OsString(path).c_str(), (LPSECURITY_ATTRIBUTES)NULL))
{
errno = ErrnoFromCreateDirectory();
return -1;
}
return 0;
}