From e0c03c9cc5d517a5ed1b0f71a65421c02f9cbc6d Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 8 Apr 2004 10:16:45 +0000 Subject: [PATCH] fix bogus error when deleting temp dir git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@8628 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 5 +++++ src/support/filetools.C | 6 ++++-- status.13x | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 920f3ce803..9eb7f7c670 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2004-04-01 Georg Baum + + * filetools.C (DeleteAllFilesInDir): delete directories with + rmdir(), unlink() does not work + 2004-03-24 Jean-Marc Lasgouttes * filetools.C (i18nLibFileSearch): simplify the logic a bit diff --git a/src/support/filetools.C b/src/support/filetools.C index 230261605c..b7d612d7f6 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -468,9 +468,11 @@ int DeleteAllFilesInDir(string const & path) bool deleted = true; FileInfo fi(unlinkpath); - if (fi.isOK() && fi.isDir()) + if (fi.isOK() && fi.isDir()) { deleted = (DeleteAllFilesInDir(unlinkpath) == 0); - deleted &= (lyx::unlink(unlinkpath) == 0); + deleted &= (lyx::rmdir(unlinkpath) == 0); + } else + deleted &= (lyx::unlink(unlinkpath) == 0); if (!deleted) { Alert::err_alert(_("Error! Could not remove file:"), unlinkpath); diff --git a/status.13x b/status.13x index 481d411c79..85b8c24333 100644 --- a/status.13x +++ b/status.13x @@ -29,6 +29,8 @@ What's new - when the autodetection of latex classes cannot be done for some reason, provide a sensible list of textclasses +- fix an annoying "could not delete temp dir" warning + - honor correctly the various locale-related environment variables when looking for translated help files