Hidden files in Windows are now backuped like any other file.

This commit is contained in:
Andrea Mazzoleni 2011-08-25 09:03:31 +02:00
parent 91a9680651
commit 322110672e
3 changed files with 15 additions and 6 deletions

View file

@ -4,6 +4,7 @@ SnapRAID HISTORY
1.6 2011/8 1.6 2011/8
========== ==========
* In "diff" now recognizes the reuse of inodes. * In "diff" now recognizes the reuse of inodes.
* Windows hidden files are now backuped like any other files.
1.5 2011/7 1.5 2011/7
========== ==========

13
TODO
View file

@ -3,7 +3,8 @@ SnapRAID TODO
This is a list of possible TODO items for SnapRAID. The order is not relevant. This is a list of possible TODO items for SnapRAID. The order is not relevant.
* Add an option to do not exclude "hidden" file automatically. * Support to backup also symlinks. It's important to allow a full backup as
many software relay on them to store important information.
* When fixing, before overwriting the present file, make a copy of it just in * When fixing, before overwriting the present file, make a copy of it just in
case that the original file cannot be completely recovered. case that the original file cannot be completely recovered.
@ -13,6 +14,9 @@ the file name cannot be supported, it's better to do not stop the sync process.
The sync process should stop only if the error could be caused by a disk The sync process should stop only if the error could be caused by a disk
corruption. corruption.
* In the speed test prints also the whole memory available in the system.
I may help to detect the slowdown cases.
* Adds a checksum for the content file. When reading if the file is invalid, * Adds a checksum for the content file. When reading if the file is invalid,
skip to another. skip to another.
@ -20,6 +24,9 @@ skip to another.
* Easy way to find files using a specified block. * Easy way to find files using a specified block.
* Add an option to exclude "hidden" file. In Windows files with the HIDDEN attributes,
in Unix files starting with '.'.
* Implement an "undelete" command to recover missing files, without the * Implement an "undelete" command to recover missing files, without the
integrity check of the existing ones. integrity check of the existing ones.
It should restore only missing files, without recovering modified ones It should restore only missing files, without recovering modified ones
@ -31,8 +38,6 @@ or check validity of data of existing ones.
* Filtered out files should be opened in read-only mode. * Filtered out files should be opened in read-only mode.
* Support to backup also symlinks.
* Rename sync->backup and fix->restore. It seems to me a naming expressing * Rename sync->backup and fix->restore. It seems to me a naming expressing
better the meaning of the commands. But not yet sure. better the meaning of the commands. But not yet sure.
@ -76,5 +81,5 @@ RAID5 sse2x2 2481 [MB/s]
RAID6 int32x2 807 [MB/s] RAID6 int32x2 807 [MB/s]
RAID6 mmxx2 1304 [MB/s] RAID6 mmxx2 1304 [MB/s]
RAID6 sse2x2 787 [MB/s] RAID6 sse2x2 787 [MB/s]
- Waiting for other similar reports. A single one may be a spurious case. - It happens in some systems. At now not an high priority issue.

View file

@ -83,9 +83,11 @@ static char* u16tou8(const wchar_t* src)
static void windows_info2stat(const BY_HANDLE_FILE_INFORMATION* info, struct windows_stat* st) static void windows_info2stat(const BY_HANDLE_FILE_INFORMATION* info, struct windows_stat* st)
{ {
/* Convert special attributes to a char device */ /* Convert special attributes to a char device */
/* Note that the FILE_ATTRIBUTE_HIDDEN attribute is intentionally ignored as */
/* hidden files should be backuped like any other */
if ((info->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0) { if ((info->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0) {
st->st_mode = S_IFBLK; st->st_mode = S_IFBLK;
} else if ((info->dwFileAttributes & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_REPARSE_POINT)) != 0) { } else if ((info->dwFileAttributes & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_REPARSE_POINT)) != 0) {
st->st_mode = S_IFCHR; st->st_mode = S_IFCHR;
} else if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { } else if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
st->st_mode = S_IFDIR; st->st_mode = S_IFDIR;
@ -122,11 +124,12 @@ static void windows_info2stat(const BY_HANDLE_FILE_INFORMATION* info, struct win
static void windows_finddata2stat(const WIN32_FIND_DATAW* info, struct windows_stat* st) static void windows_finddata2stat(const WIN32_FIND_DATAW* info, struct windows_stat* st)
{ {
/* Convert special attributes */ /* Convert special attributes */
/* Note that the FILE_ATTRIBUTE_HIDDEN attribute is intentionally ignored as */
/* hidden files should be backuped like any other */
if ((info->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0) { if ((info->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0) {
st->st_mode = S_IFBLK; st->st_mode = S_IFBLK;
} else if ((info->dwFileAttributes & ( } else if ((info->dwFileAttributes & (
FILE_ATTRIBUTE_SYSTEM /* System files */ FILE_ATTRIBUTE_SYSTEM /* System files */
| FILE_ATTRIBUTE_HIDDEN /* Hidden files */
| FILE_ATTRIBUTE_TEMPORARY /* Files going to be deleted on close */ | FILE_ATTRIBUTE_TEMPORARY /* Files going to be deleted on close */
| FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_OFFLINE
| FILE_ATTRIBUTE_REPARSE_POINT /* Symbolic links */ | FILE_ATTRIBUTE_REPARSE_POINT /* Symbolic links */