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!