[PATCH] Add a removeDir function to KDE 3.5.x
nicolasg at snafu.de
Tue Feb 28 08:12:45 GMT 2006
The attached patch is for branches/KDE/3.5/kdelibs/kdecore
The patch adds a function KStandardDirs::removeDir to remove a directory and
its contents (recursively). This more intended for directories under the
control of the computer (as opposed to KIO::NetAccess:del where there is user
feedback for long operations).
The goal is to use it in KTempDir:.unlink to replace the ::system( "/bin/rm
-rf something") call, which is not portable.
I have tried to program the function defensively to avoid potential traps. If
I have missed any trap, please tell.
I have chosen to add it to KStandardDirs as there is
KStandardDirs::makeDirs and also other functions using the opendir/readdir/
If you are ok with it, I will commit the patch for KDE 3.5.2 and then port it
(By the way, I have tried to ask Qt Bugs for such a function in QDir (issue
N104800) but it was refused.)
Have a nice day!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4359 bytes
Desc: not available
More information about the kde-core-devel