Using dir with multiple wildcards for directories

조회 수: 9 (최근 30일)
Leo Simon
Leo Simon 2014년 11월 20일
댓글: Leo Simon 2014년 11월 20일
I'd like to be able to use dir to list all files in the grandchildren directories of my cwd, as in
dir('*/*')
As far as I can tell, this is impossible, is there a recommended workaround for this?
Thanks, Leo

채택된 답변

Geoff Hayes
Geoff Hayes 2014년 11월 20일
Leo - look in the File Exchange for a recursive directory listing submission. One such example is rdir.
  댓글 수: 1
Leo Simon
Leo Simon 2014년 11월 20일
Thanks Geoff. rdir is exactly what I was looking for. For the benefit of others, typing
rdir('*/*')
gives more information than perhaps one would like, but, like dir,
D = rdir(*/*)
returns a struct so you can then extract just names, or modification dates.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by