comment savoir si un dossier est vide

2 visualizaciones (últimos 30 días)
Dann Laneuville
Dann Laneuville el 24 de Sept. de 2024
Comentada: Mathieu NOE el 2 de Oct. de 2024
comment savoir si un dossier (folder) est vide en une instruction

Respuestas (1)

Mathieu NOE
Mathieu NOE el 24 de Sept. de 2024
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)
  2 comentarios
Dann Laneuville
Dann Laneuville el 30 de Sept. de 2024
Thank you very much
Mathieu NOE
Mathieu NOE el 2 de Oct. de 2024
my pleasure !

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!