FIX: Bug [0001040] Synchronize Directory give a blocking error of "Access Violation" when try to Synchronize with network folder

This commit is contained in:
Alexander Koblov 2015-04-25 19:25:28 +00:00
commit db92f5cdcf
4 changed files with 21 additions and 8 deletions

View file

@ -81,6 +81,7 @@ type
function GetRootDir: String; override; overload;
function GetPathType(sPath : String): TPathType; override;
function CreateDirectory(const Path: String): Boolean; override;
function GetFreeSpace(Path: String; out FreeSize, TotalSize : Int64) : Boolean; override;
function CreateListOperation(TargetPath: String): TFileSourceOperation; override;
@ -713,6 +714,11 @@ begin
Result := DCStrUtils.GetPathType(sPath);
end;
function TFileSystemFileSource.CreateDirectory(const Path: String): Boolean;
begin
Result := mbCreateDir(Path);
end;
function TFileSystemFileSource.GetFreeSpace(Path: String; out FreeSize, TotalSize : Int64) : Boolean;
begin
Result := uOSUtils.GetDiskFreeSpace(Path, FreeSize, TotalSize);

View file

@ -88,6 +88,7 @@ type
function GetPathType(sPath : String): TPathType;
function GetFreeSpace(Path: String; out FreeSize, TotalSize : Int64) : Boolean;
function GetLocalName(var aFile: TFile): Boolean;
function CreateDirectory(const Path: String): Boolean;
function GetConnection(Operation: TFileSourceOperation): TFileSourceConnection;
procedure RemoveOperationFromQueue(Operation: TFileSourceOperation);
@ -259,6 +260,7 @@ type
function GetRootDir: String; virtual; overload;
function GetPathType(sPath : String): TPathType; virtual;
function CreateDirectory(const Path: String): Boolean; virtual;
function GetFreeSpace(Path: String; out FreeSize, TotalSize : Int64) : Boolean; virtual;
function GetLocalName(var aFile: TFile): Boolean; virtual;
@ -552,6 +554,11 @@ begin
end;
end;
function TFileSource.CreateDirectory(const Path: String): Boolean;
begin
Result := False;
end;
function TFileSource.GetFreeSpace(Path: String; out FreeSize, TotalSize : Int64) : Boolean;
begin
Result := False; // not supported by default

View file

@ -119,6 +119,7 @@ type
var theNewProperties: TFileProperties): TFileSourceOperation; override;
function GetLocalName(var aFile: TFile): Boolean; override;
function CreateDirectory(const Path: String): Boolean; override;
class function IsSupportedPath(const Path: String): Boolean; override;
class function CreateByRootName(aRootName: String): IWfxPluginFileSource;
@ -849,8 +850,12 @@ begin
end;
end;
class function TWfxPluginFileSource.IsSupportedPath(const Path: String
): Boolean;
function TWfxPluginFileSource.CreateDirectory(const Path: String): Boolean;
begin
Result:= WfxModule.WfxMkDir(ExtractFilePath(Path), Path) = WFX_SUCCESS;
end;
class function TWfxPluginFileSource.IsSupportedPath(const Path: String): Boolean;
begin
Result:= Pos('wfx://', Path) = 1;
end;

View file

@ -383,12 +383,7 @@ var
begin
Fs.Path:= fs[0].Path;
// Create destination directory
with Dst.CreateCreateDirectoryOperation(PathDelim, Dest) do
try
Execute;
finally
Free;
end;
Dst.CreateDirectory(Dest);
// Determine operation type
case OperationType of
fsoCopy: