comment savoir si un dossier est vide
3 次查看(过去 30 天)
显示 更早的评论
comment savoir si un dossier (folder) est vide en une instruction
0 个评论
回答(1 个)
Mathieu NOE
2024-9-24
hello
The dir structure will return only the two directories entries '.' and '..'. So, check length(d)==2, if that is the case the folder is empty
emptyfolder = (length(dir(folderName))==2) % logical output (1 if folder empty)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!