Thread Subject: dir find no files ?

Subject: dir find no files ?

From: Xiao LI

Date: 7 Nov, 2009 01:29:04

Message: 1 of 2

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 ?

Subject: dir find no files ?

From: Steven Lord

Date: 8 Nov, 2009 23:53:16

Message: 2 of 2


"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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
loop Xiao LI 6 Nov, 2009 20:34:08
no file Xiao LI 6 Nov, 2009 20:34:08
dir Xiao LI 6 Nov, 2009 20:34:06
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com