From 14811a586d77ab9a1fa8bef360250992aead55d1 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 17 Feb 2021 18:12:33 -0500 Subject: started process-win.c --- filesystem-win.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'filesystem-win.c') diff --git a/filesystem-win.c b/filesystem-win.c index 8d7a95a..c6c64dd 100644 --- a/filesystem-win.c +++ b/filesystem-win.c @@ -1,6 +1,7 @@ #include "filesystem.h" #include #include +#include FsType fs_path_type(char const *path) { struct _stat statbuf = {0}; @@ -13,7 +14,12 @@ FsType fs_path_type(char const *path) { return FS_OTHER; } -#error "TODO: fs_path_permission" +FsPermission fs_path_permission(char const *path) { + FsPermission permission = 0; + if (_access(path, 04) == 0) permission |= FS_PERMISSION_READ; + if (_access(path, 02) == 0) permission |= FS_PERMISSION_WRITE; + return permission; +} bool fs_file_exists(char const *path) { return fs_path_type(path) == FS_FILE; -- cgit v1.2.3