summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-09-23 15:16:36 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-09-23 15:16:36 +0200
commite5630511e0a5182f7c7249a0cb047725b41b7163 (patch)
tree03b12be15c426699d7420289ad88330718d8abc1
parent41773e58a1e654688bda3aa64e450d24586ef0f3 (diff)
downloadtuxcmd-e5630511e0a5182f7c7249a0cb047725b41b7163.tar.xz
Enable experimental mkdir with parents by default
It was previously disabled due to some reason, unknown to me now.
-rw-r--r--UEngines.pas12
-rw-r--r--UGnome.pas2
2 files changed, 9 insertions, 5 deletions
diff --git a/UEngines.pas b/UEngines.pas
index 9483dfb..b77d7e3 100644
--- a/UEngines.pas
+++ b/UEngines.pas
@@ -185,7 +185,7 @@ procedure FreeDataItem(DataItem: PDataItem); overload;
implementation
-uses SysUtils, UCoreUtils;
+uses SysUtils, UCoreUtils, UGnome;
(********************************************************************************************************************************)
constructor TPanelEngine.Create;
@@ -446,15 +446,17 @@ begin
// DebugMsg(['(II) TLocalTreeEngine.MakeDir: begin']);
Result := __mkdir(PChar(NewDir), OctalToAttr(ConfDefaultDirCreationMask));
// DebugMsg(['(II) TLocalTreeEngine.MakeDir: Result = ', Result]);
- if Result <> 0 then Result := errno;
-(*
+// if Result <> 0 then Result := errno;
+
if Result <> 0 then try
- if Self.DirectoryExists(NewDir) { or (not g_mkdir_with_parents(dd))} {ForceDirectories(NewDir))} then Result := errno;
+ if Self.DirectoryExists(NewDir) or (g_mkdir_with_parents(PChar(NewDir), OctalToAttr(ConfDefaultDirCreationMask)) <> 0) {ForceDirectories(NewDir))}
+ then Result := errno
+ else Result := 0;
except
Result := -1;
DebugMsg(['(II) TLocalTreeEngine.MakeDir: Exception']);
end;
-*)
+
// DebugMsg(['(II) TLocalTreeEngine.MakeDir: end']);
end;
diff --git a/UGnome.pas b/UGnome.pas
index 3370e43..347d0b6 100644
--- a/UGnome.pas
+++ b/UGnome.pas
@@ -208,6 +208,7 @@ var libGlib2Handle, libGtk2Handle, libGnome2Handle, libGnomeUI2Handle: Pointer;
_type:TGtkMessageType; buttons:TGtkButtonsType;
message_format:Pgchar):PGtkWidget; varargs; cdecl;
{$ENDIF}
+ g_mkdir_with_parents: function (const pathname: PChar; mode: integer): integer; cdecl;
@@ -1589,6 +1590,7 @@ begin
if libGlib2Handle = nil then libGlib2Handle := dlopen('libglib-2.0.so', RTLD_LAZY);
if libGlib2Handle <> nil then begin
@g_filename_display_name := dlsym(libGlib2Handle, 'g_filename_display_name');
+ @g_mkdir_with_parents := dlsym(libGlib2Handle, 'g_mkdir_with_parents');
DebugMsg(['libglib-2.0.so loaded, @g_filename_display_name = 0x', IntToHex(QWORD(@g_filename_display_name), 8)]);
end;
libGtk2Handle := dlopen('libgtk-x11-2.0.so.0', RTLD_LAZY);