On Mon, 30 Apr 2012 14:16:22 +0200 "Ludo Brands" <[email protected]> wrote:
> > Regarding issue #21855 > > http://bugs.freepascal.org/view.php?id=21855 > > > > I am planning to reject the patch but I would like to have other > > opinions, too. > > I'm in favor of patch with current definition (no default parameters as > suggested by Bart) and with following ammendment: > > if RemoveReadOnlyFiles and ((FileInfo.Attr and faReadOnly)>0) then > if FileSetAttrUTF8(CurFilename, FileInfo.Attr-faReadOnly) <> 0 then > exit; > > Instead of > > if RemoveReadOnlyFiles and ((FileInfo.Attr and faReadOnly)>0) then > FileSetAttrUTF8(CurFilename, FileInfo.Attr-faReadOnly); > > This way the function exits as soon as something goes wrong. No need > iterating in directories when the attribute of the directory itself can't be > changed. How to find out what went wrong? Maybe add parameter 'ExceptionOnError:boolean=false' and if true then raise an exception with the file name. Mattias -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
