目录是空的,但laravel不会删除它,抛出错误"它不是空的"

时间:2018-03-27 14:17:13

标签: php laravel directory rmdir

我试图删除许多已经为空且具有特定条件的目录:

(load-theme ',theme t)

这给我错误: ErrorException:rmdir(images / noticias / 10446 /):目录不为空 但目录是空的,任何想法?我也尝试删除最后一个" /"在$ dirPath。

1 个答案:

答案 0 :(得分:0)

我已使用1,vcom : compile all sources files and testbench 2,vsim : load testbench for simulation 3,view structure/signals/wave : open some windows 4,add wave : add signals to waveform window 5,run xx us : run simulation for a certain time 代替File::deletedirectory($dirPath)解决了问题:

rmdir($dirPath)

别忘了添加:$noticias = Noticia::where('id_idioma', '2')->get(); foreach($noticias as $noticia){ $id = $noticia->id; $dirPath='images/noticias/'.$id.'/'; File::deletedirectory($dirPath); }

相关问题