strncpy(path, path_ptr, path_len);
path[path_len] = 0;
+ #if _BH_WINDOWS
+ DWORD attrs = GetFileAttributesA(path);
+ attrs &= ~FILE_ATTRIBUTE_READONLY;
+ SetFileAttributesA(path, attrs);
+ #endif
+
results->data[0] = WASM_I32_VAL(bh_file_remove(path));
return NULL;
}
}
rolling_parent := make(dyn_str);
- path := string.split(actual_dest, '/');
+ path := string.split(actual_dest, os.PATH_SEP);
for path[0 .. path.length-1] {
string.append(&rolling_parent, it);
- string.append(&rolling_parent, "/");
+ string.append(&rolling_parent, os.PATH_SEP);
if !os.dir_exists(rolling_parent) {
os.dir_create(rolling_parent);
GB_DLL_IMPORT DWORD GetCurrentDirectory(DWORD nBufferLength, char *lpBuffer);
GB_DLL_IMPORT BOOL SetCurrentDirectory(char *lpPathName);
+
+GB_DLL_IMPORT DWORD GetFileAttributesA(char *lpPathName);
+GB_DLL_IMPORT BOOL SetFileAttributesA(char *lpPathName, DWORD attrs);
\ No newline at end of file