CopyDirTree do not work on linux
Original Reporter info from Mantis: imants_gulbis
-
Reporter name: Imants Gulbis
Original Reporter info from Mantis: imants_gulbis
- Reporter name: Imants Gulbis
Description:
CopyDirTree do not work on Linux because on Linux everything is on RelPath and it fails
this check:
// Don't even try to copy to a subdirectory of SourceDir.
B := TryCreateRelativePath(LazFileUtils.ExpandFilenameUtf8(Searcher.FSourceDir),
LazFileUtils.ExpandFilenameUtf8(Searcher.FTargetDir), False, True, RelPath);
if B and ((Copy(RelPath,1,2) = '..') or (RelPath = '')) then Exit;
In Linux everything starts with root "/" directory so everything is relative to anything. I think it will fail on windows too if files are not in different drives.
I think you should check
if Pos(LazFileUtils.ExpandFilenameUtf8(Searcher.FTargetDir), LazFileUtils.ExpandFilenameUtf8(Searcher.FSourceDir)) = 1 then
Exit;
Because if I copy something from source directory to same source directory but different folder then it still should contain full source directory path in target directory.
Mantis conversion info:
- Mantis ID: 31015
- Version: 1.6