From a84dd7b424756f5d7f62153493ff1f36a6616ef0 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 26 Nov 2016 20:40:10 -0500 Subject: [PATCH] win32 attribute mapping. --- src/win32_host_fst.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/win32_host_fst.c b/src/win32_host_fst.c index a8ae021..03f45a1 100644 --- a/src/win32_host_fst.c +++ b/src/win32_host_fst.c @@ -533,7 +533,19 @@ static word32 get_file_info(const char *path, struct file_info *fi) { // 0x40 = rename enable // 0x80 = destroy enable - fi->access = 0xc3; // placeholder... + word16 access = 0; + + if (info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + access = 0x01; + else + access = 0x01 | 0x02 | 0x40 | 0x80; + + if (info.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) + access |= 0x04; + + // map FILE_ATTRIBUTE_ARCHIVE to backup needed bit? + + fi->access = access; // get file type/aux type