14 BOOL result = DeleteFileA(path);
18 return GetLastError();
29 BOOL result = CreateDirectoryA(path, NULL);
32 DWORD error = GetLastError();
33 if (error == ERROR_ALREADY_EXISTS)
47 BOOL result = RemoveDirectoryA(path);
50 return GetLastError();
59 DWORD attributes = GetFileAttributesA(path);
61 if (attributes != INVALID_FILE_ATTRIBUTES)
64 return (attributes & FILE_ATTRIBUTE_DIRECTORY)
69 DWORD error = GetLastError();
70 if (error == ERROR_FILE_NOT_FOUND || error == ERROR_PATH_NOT_FOUND)
88 return GetCurrentDirectoryA((DWORD)
size, buffer);
os_dirent_t
directory entry type
#define STA_DECL
sal2 annotation on function implementations to copy annotations from the declaration
#define CTASSERT(expr)
assert a condition, prints the condition as a message
#define CTASSERTF(expr,...)
assert a condition with a message and optional format arguments
STA_DECL size_t os_cwd_get_string(char *buffer, size_t size)
STA_DECL os_error_t os_dir_create(const char *path)
check if a directory exists
STA_DECL os_dirent_t os_dirent_type(const char *path)
get the type of a paths inode entry
STA_DECL os_error_t os_file_delete(const char *path)
delete a file
STA_DECL os_error_t os_dir_delete(const char *path)
delete a directory