dir method stops at 1000 files sometimes

I have been struggling with the dir function lately.
the dir method often stops enumerating the directory at 1000 files. If I query enough times, I will finally get the correct count. see below (copied from matlab command line) where I have called dir two times in a row and get drastically different answers. nothing changed between calls....I called one right after the other. Has anyone had this issue or found a workaround?
This is a network drive I'm reading so that may be part of the issue.
>> sublist = dir([imdir_win '\*.tif*'])
sublist =
1000×1 struct array with fields:
>> sublist = dir([imdir_win '\*.tif*'])
sublist =
7066×1 struct array with fields:

댓글 수: 2

Image Analyst
Image Analyst 2023년 12월 14일
편집: Image Analyst 2023년 12월 14일
I don't know. Weird. I don't think it should make a difference but what if you use fullfile?
sublist = dir(fullfile(imdir_win, '*.tif*'))
Walter Roberson
Walter Roberson 2023년 12월 14일
Unfortunately the fact that it is a network drive has everything to do with it.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2023년 12월 14일

댓글:

2023년 12월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by