[Lazarus] Removing read-only files in FileUtil.DeleteDirectory ?
Jürgen Hestermann
juergen.hestermann at gmx.de
Mon Apr 30 17:40:25 CEST 2012
Bart schrieb:
> I would change the declaration to:
> function DeleteDirectory(const DirectoryName: string;
> OnlyChilds: boolean; const RemoveReadOnlyFiles: Boolean =
False): boolean;
Yes, I think this needs to be changed/added
.
And what about system-hidden files?
Are they already deleted by DeleteDirectory?
In general, there was a reason for having read-only attributes in the past
but meanwhile it is of not much use anymore because many programs
delete such files anyway (as this thread shows ;-)).
> One might also consider retuning the actual filename/foldername that
> could not be removed if things fail, so feedback to the user can be
> given.
This would only make sense if a programmer wants to present the file name
to a user. But if the only reason is to know which file attributes have
to be
changed and let the program try to delete them again, then the programmer
should be saved to do such crude cycles and a flag should tell the
routine to
delete in all cases (read-only or not).
More information about the Lazarus
mailing list