comment savoir si un dossier est vide
조회 수: 4 (최근 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!