mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Fixes root directory creation in Windows.
This commit is contained in:
parent
e8b2d359d6
commit
3768ac329c
3 changed files with 22 additions and 2 deletions
9
HISTORY
9
HISTORY
|
|
@ -22,6 +22,15 @@ SnapRAID HISTORY
|
|||
directory tree.
|
||||
* Changes the 'dup' output format to include the size of each duplicate file.
|
||||
|
||||
3.2 2013/7
|
||||
==========
|
||||
* Fix a directory creation problem in Windows when the "disk" option points to
|
||||
the root directory of a drive. Now SnapRAID won't complain about the
|
||||
inability to create such directory.
|
||||
If you encouter this problem when trying to recover your data, just upgrade
|
||||
to this version, and you'll be able to complete the recovering process.
|
||||
No need to upgrade for platforms different from Windows.
|
||||
|
||||
3.1 2013/5
|
||||
==========
|
||||
* Direct use of Windows API for disk access to improve error reporting.
|
||||
|
|
|
|||
2
TODO
2
TODO
|
|
@ -5,6 +5,8 @@ This is the list of TODO items for SnapRAID.
|
|||
|
||||
- v4.0
|
||||
|
||||
* Don't enforce different disk in fix. It could allow to recover in spare space of a disk already used.
|
||||
|
||||
* In the import list, uses also all the blocks in the array.
|
||||
But we must cover the case of bad blocks. Likely we can just check the
|
||||
hash after reading, and in case, skip it, and retry with another copy.
|
||||
|
|
|
|||
13
util.c
13
util.c
|
|
@ -687,9 +687,9 @@ int mkancestor(const char* file)
|
|||
{
|
||||
char dir[PATH_MAX];
|
||||
char* c;
|
||||
|
||||
|
||||
pathcpy(dir, sizeof(dir), file);
|
||||
|
||||
|
||||
c = strrchr(dir, '/');
|
||||
if (!c) {
|
||||
/* no ancestor */
|
||||
|
|
@ -699,11 +699,20 @@ int mkancestor(const char* file)
|
|||
/* clear the file */
|
||||
*c = 0;
|
||||
|
||||
/* if it's the root dir */
|
||||
if (*dir == 0) {
|
||||
/* nothing more to do */
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
/* if it's a drive specificaion like "C:" */
|
||||
if (isalpha(dir[0]) && dir[1] == ':' && dir[2] == 0) {
|
||||
/* nothing more to do */
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* try creating it */
|
||||
if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0) {
|
||||
/* just created */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue