Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: dir find no files ?
Date: Sun, 8 Nov 2009 18:53:16 -0500
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <hd7ljg$iv5$1@fred.mathworks.com>
References: <hd2ih0$47i$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1257724336 19429 172.31.44.65 (8 Nov 2009 23:52:16 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 Nov 2009 23:52:16 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:583437



"Xiao LI" <clz1978@163.com> wrote in message 
news:hd2ih0$47i$1@fred.mathworks.com...
>I used the function "dir" to get all the file names within a certain 
>directory in a loop.
> The directory is changing in the loop, but the files in each directory are 
> same. What is weird is that the "dir" find no files in one of the 
> directories while acturally there are several files in it. Then I check 
> the directory independently(not in a loop) and the "dir" find those files. 
> I don't know why. The memory full ?

Impossible to say.  How, specifically do you call DIR?  Are you certain that 
the way you're actually calling it is the way you think you're calling it? 
For example, there's a difference between:

D = dir('abc*')

and

D = dir('abc')

Are you sure you're calling DIR in the correct directory?  Being one level 
higher or lower in a directory structure can make a huge difference on what 
DIR can 'see'.

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ