Now handles files at the root of the source volume. Fixes bug #1227
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21192 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -241,13 +241,18 @@ CopyEngine::CopyFolder(BDirectory &srcDir, BDirectory &targetDir)
|
|||||||
BEntry entry;
|
BEntry entry;
|
||||||
status_t err;
|
status_t err;
|
||||||
while (srcDir.GetNextEntry(&entry) == B_OK) {
|
while (srcDir.GetNextEntry(&entry) == B_OK) {
|
||||||
char name[B_FILE_NAME_LENGTH];
|
StatStruct statbuf;
|
||||||
entry.GetName(name);
|
entry.GetStat(&statbuf);
|
||||||
if (strcmp(name, PACKAGES_DIRECTORY) == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Undo undo;
|
Undo undo;
|
||||||
err = FSCopyFolder(&entry, &targetDir, fControl, NULL, false, undo);
|
if (S_ISDIR(statbuf.st_mode)) {
|
||||||
|
char name[B_FILE_NAME_LENGTH];
|
||||||
|
if (strcmp(name, PACKAGES_DIRECTORY) == 0)
|
||||||
|
continue;
|
||||||
|
err = FSCopyFolder(&entry, &targetDir, fControl, NULL, false, undo);
|
||||||
|
} else {
|
||||||
|
err = FSCopyFile(&entry, &statbuf, &targetDir, fControl, NULL, false, undo);
|
||||||
|
}
|
||||||
if (err != B_OK) {
|
if (err != B_OK) {
|
||||||
BPath path;
|
BPath path;
|
||||||
entry.GetPath(&path);
|
entry.GetPath(&path);
|
||||||
|
|||||||
@@ -1512,20 +1512,18 @@ FSCopyAttributesAndStats(BNode *srcNode, BNode *destNode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
status_t
|
status_t
|
||||||
FSCopyFile(BEntry* srcFile, StatStruct *srcStat, BDirectory* destDir,
|
FSCopyFile(BEntry* srcFile, StatStruct *srcStat, BDirectory* destDir,
|
||||||
CopyLoopControl *loopControl, BPoint *loc, bool makeOriginalName)
|
CopyLoopControl *loopControl, BPoint *loc, bool makeOriginalName, Undo &undo)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
CopyFile(srcFile, srcStat, destDir, loopControl, loc, makeOriginalName);
|
CopyFile(srcFile, srcStat, destDir, loopControl, loc, makeOriginalName, undo);
|
||||||
} catch (status_t error) {
|
} catch (status_t error) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ TrackerCopyLoopControl::TrackerCopyLoopControl(thread_id thread)
|
|||||||
#endif
|
#endif
|
||||||
_IMPEXP_TRACKER status_t FSCopyAttributesAndStats(BNode *, BNode *);
|
_IMPEXP_TRACKER status_t FSCopyAttributesAndStats(BNode *, BNode *);
|
||||||
|
|
||||||
|
_IMPEXP_TRACKER status_t FSCopyFile(BEntry* srcFile, StatStruct *srcStat, BDirectory* destDir,
|
||||||
|
CopyLoopControl *loopControl, BPoint *loc, bool makeOriginalName, Undo &undo);
|
||||||
_IMPEXP_TRACKER status_t FSCopyFolder(BEntry *srcEntry, BDirectory *destDir, CopyLoopControl *loopControl,
|
_IMPEXP_TRACKER status_t FSCopyFolder(BEntry *srcEntry, BDirectory *destDir, CopyLoopControl *loopControl,
|
||||||
BPoint *loc, bool makeOriginalName, Undo &undo);
|
BPoint *loc, bool makeOriginalName, Undo &undo);
|
||||||
_IMPEXP_TRACKER void FSDuplicate(BObjectList<entry_ref> *srcList, BList *pointList);
|
_IMPEXP_TRACKER void FSDuplicate(BObjectList<entry_ref> *srcList, BList *pointList);
|
||||||
|
|||||||
Reference in New Issue
Block a user