Borrar filtros
Borrar filtros

Need fast way to find folders using DIR command

3 visualizaciones (últimos 30 días)
Darin McCoy
Darin McCoy el 1 de Jul. de 2011
Hi - i'm trying to find only folders using the DIR command the fastest way possible. I realize the dir command returns a value "isdir" which can help you decipher this faster, however, i need something faster than that.
In past versions of maltab, i have been able to use something like
dir('C:\.*')
to bring up only folders....however this doesn't work now. any ideas? (or is my best bet to write a c function to do it?)

Respuestas (1)

Matt Fig
Matt Fig el 1 de Jul. de 2011
What version are you using, because this works on 2007b:
dir('C:\*.') % Note the . and * are transposed from yours.
  3 comentarios
Matt Fig
Matt Fig el 1 de Jul. de 2011
Did you try it with the . and * transposed from what you showed?
Darin McCoy
Darin McCoy el 1 de Jul. de 2011
literally - the exact command was the same from version to version.
My simple example is this
dir('C:\.*')

Iniciar sesión para comentar.

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by