[tarantool-patches] Re: [PATCH] lua: fix fio.rmtree to work with non empty dirs

  • From: Konstantin Osipov <kostja@xxxxxxxxxxxxx>
  • To: tarantool-patches@xxxxxxxxxxxxx
  • Date: Fri, 27 Jul 2018 00:32:11 +0300

* Alexander Turenko <alexander.turenko@xxxxxxxxxxxxx> [18/07/18 09:46]:

Hi Kostya!

The patch looks good for me except one tiny comment.


I pushed an updated patch (it was not sent to this list), but
contains a fix for this review comment.

WBR, Alexander Turenko.

index 0850413d9..14e0fb72c 100644
--- a/test/app/fio.test.lua
+++ b/test/app/fio.test.lua
@@ -131,6 +131,13 @@ fio.rmdir(dir2)
 
 { fio.unlink(file1), fio.unlink(file2), fio.unlink(file3), 
fio.unlink(file4) }
 { fio.unlink(file1), fio.unlink(file2), fio.unlink(file3), 
fio.unlink(file4) }
+
+-- gh-3258 rmtree should remove directories with files
+fio.mktree('tmp2/tmp3/tmp4')
+fh = fio.open('tmp2/tmp3/tmp4/tmp.txt', {'O_RDWR', 'O_CREAT'})
+fh:close()
+fio.rmtree('tmp2')
+

I think it would be good to check that the directory really disappears
(via fio.listdir()).

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

Other related posts: