mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
ADD: Logging CreateDirectory function
This commit is contained in:
parent
db92f5cdcf
commit
ab2203ae53
2 changed files with 19 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue