What unit is DeleteDirectory in? lazarus / 61-Beginners ---------------------------------------------------------------------- bulrush · 2016-06-16 22:42 I found the documentation and it says DeleteDirectory is in fileutil but my compiler cannot find it. What could be wrong? If my compiler path is wrong how do I fix it? Thank you! ---------------------------------------------------------------------- RAW · 2016-06-16 23:25 There's no need to fix something... just check the INTERFACE part of the unit: uses  FileUtil This is not enough: FileUtil.DeleteDirectory.... (is not working on my computer). ---------------------------------------------------------------------- lainz · 2016-06-17 00:51 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);begin  FileUtil.DeleteDirectory('C:\Test\', False);end; Is working for me, just ensure that the second parameter is False. The file is located at C:\lazarus\components\lazutils Be sure to include LazUtils package or even better LCL if you are using a command line application. ---------------------------------------------------------------------- bylaardt · 2016-06-17 01:30 Quote from: SoE on June 17, 2016, 01:25:03 amThis is not enough: FileUtil.DeleteDirectory.... (is not working on my computer). try this: Code: [Select]  system.rmdir(filename);   LazFileUtils.RemoveDirUTF8(filename); ---------------------------------------------------------------------- marcov · 2016-06-17 08:13 Sysutils.removedir :-) ---------------------------------------------------------------------- Thaddy · 2016-06-17 08:22 Quote from: marcov on June 17, 2016, 10:13:31 amSysutils.removedir :-) Yup. But he is referring to documentation? I didn't find it yet, but that would be wrong if it is there and not in any sourcecode. ---------------------------------------------------------------------- RAW · 2016-06-17 17:25 Hmmm... that's funny... all of them are working as expected, but the second one only if I put LazFileUtils under USES. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i System.rmdi r('I:\(DOWNLOADS)\TestLaz'); LazFileUtils.RemoveDirUTF8('I:\(DOWNLOADS )\TestLaz'); // uses LazFileUtils SysUtils.RemoveDir('I:\(DOWNLOADS)\TestLaz'); ---------------------------------------------------------------------- Leledumbo · 2016-06-17 19:30 Quote from: SoE on June 17, 2016, 07:25:07 pmHmmm... that's funny... all of them are working as expected, but the second one only if I put LazFileUtils under USES. Unit prefixed identifier reference primary usage is to avoid naming clash (such as the need to call System.Assign inside TPersistent methods, where the class also has method named Assign thus unprefixed reference will call that instead of the one from System unit) by specifically stating which identifier is referred. It doesn't override unit usage in the uses clause, that must always be specified.