mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 04:46:46 -05:00
Doesn't exclude anymore system files in Windows.
This commit is contained in:
parent
e1e8ec9cfd
commit
db330b9d0b
2 changed files with 35 additions and 19 deletions
50
mingw.c
50
mingw.c
|
|
@ -312,13 +312,10 @@ static void windows_info2stat(const BY_HANDLE_FILE_INFORMATION* info, const FILE
|
|||
if ((info->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0) {
|
||||
st->st_mode = S_IFBLK;
|
||||
st->st_desc = "device";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) != 0) { /* System */
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_desc = "system";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) != 0) { /* Offline */
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_desc = "offline";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY) != 0) { /* Files going to be deleted on close */
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY) != 0) { /* Temporary */
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_desc = "temporary";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) { /* Reparse point */
|
||||
|
|
@ -356,12 +353,22 @@ static void windows_info2stat(const BY_HANDLE_FILE_INFORMATION* info, const FILE
|
|||
st->st_desc = "reparse-point";
|
||||
break;
|
||||
}
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
st->st_mode = S_IFDIR;
|
||||
st->st_desc = "directory";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) != 0) { /* System */
|
||||
if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_desc = "system-directory";
|
||||
} else {
|
||||
st->st_mode = S_IFREG;
|
||||
st->st_desc = "system-file";
|
||||
}
|
||||
} else {
|
||||
st->st_mode = S_IFREG;
|
||||
st->st_desc = "regular";
|
||||
if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
st->st_mode = S_IFDIR;
|
||||
st->st_desc = "directory";
|
||||
} else {
|
||||
st->st_mode = S_IFREG;
|
||||
st->st_desc = "regular";
|
||||
}
|
||||
}
|
||||
|
||||
/* Store the HIDDEN attribute in a separate field */
|
||||
|
|
@ -405,13 +412,10 @@ static void windows_finddata2stat(const WIN32_FIND_DATAW* info, struct windows_s
|
|||
if ((info->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0) {
|
||||
st->st_mode = S_IFBLK;
|
||||
st->st_desc = "device";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) != 0) { /* System */
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_desc = "system";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) != 0) { /* Offline */
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_desc = "offline";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY) != 0) { /* Files going to be deleted on close */
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY) != 0) { /* Temporary */
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_desc = "temporary";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) { /* Reparse point */
|
||||
|
|
@ -449,12 +453,22 @@ static void windows_finddata2stat(const WIN32_FIND_DATAW* info, struct windows_s
|
|||
st->st_desc = "reparse-point";
|
||||
break;
|
||||
}
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
st->st_mode = S_IFDIR;
|
||||
st->st_desc = "directory";
|
||||
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) != 0) { /* System */
|
||||
if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
st->st_mode = S_IFCHR;
|
||||
st->st_desc = "system-directory";
|
||||
} else {
|
||||
st->st_mode = S_IFREG;
|
||||
st->st_desc = "system-file";
|
||||
}
|
||||
} else {
|
||||
st->st_mode = S_IFREG;
|
||||
st->st_desc = "regular";
|
||||
if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
|
||||
st->st_mode = S_IFDIR;
|
||||
st->st_desc = "directory";
|
||||
} else {
|
||||
st->st_mode = S_IFREG;
|
||||
st->st_desc = "regular";
|
||||
}
|
||||
}
|
||||
|
||||
/* Store the HIDDEN attribute in a separate field */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue