ADD: Logging CreateDirectory function

This commit is contained in:
Alexander Koblov 2015-04-25 19:37:55 +00:00
commit ab2203ae53
2 changed files with 19 additions and 1 deletions

View file

@ -122,7 +122,7 @@ type
implementation
uses
uOSUtils, DCOSUtils, DCDateTimeUtils, uGlobs, uGlobsPaths,
uOSUtils, DCOSUtils, DCDateTimeUtils, uGlobs, uGlobsPaths, uLog, uLng,
{$IFDEF MSWINDOWS}
uMyWindows, Windows,
{$ENDIF}
@ -717,6 +717,15 @@ end;
function TFileSystemFileSource.CreateDirectory(const Path: String): Boolean;
begin
Result := mbCreateDir(Path);
if Result then
begin
if (log_dir_op in gLogOptions) and (log_success in gLogOptions) then
logWrite(Format(rsMsgLogSuccess + rsMsgLogMkDir, [Path]), lmtSuccess);
end
else begin
if (log_dir_op in gLogOptions) and (log_errors in gLogOptions) then
logWrite(Format(rsMsgLogError + rsMsgLogMkDir, [Path]), lmtError);
end;
end;
function TFileSystemFileSource.GetFreeSpace(Path: String; out FreeSize, TotalSize : Int64) : Boolean;

View file

@ -853,6 +853,15 @@ end;
function TWfxPluginFileSource.CreateDirectory(const Path: String): Boolean;
begin
Result:= WfxModule.WfxMkDir(ExtractFilePath(Path), Path) = WFX_SUCCESS;
if Result then
begin
if (log_vfs_op in gLogOptions) and (log_success in gLogOptions) then
logWrite(Format(rsMsgLogSuccess + rsMsgLogMkDir, [Path]), lmtSuccess)
end
else begin
if (log_vfs_op in gLogOptions) and (log_errors in gLogOptions) then
logWrite(Format(rsMsgLogError + rsMsgLogMkDir, [Path]), lmtError);
end;
end;
class function TWfxPluginFileSource.IsSupportedPath(const Path: String): Boolean;