Invalid file properties returned by dir
이전 댓글 표시
So, I've been using dir to quickly get me a catalogue of all the file sizes of a specific type of file. My code works, however, there is one particular file, which returns into the output:
name: 'dagkgjkajk.his'
date: ''
bytes: []
isdir: 0
datenum: []
Does anyone know why this may be the case?
댓글 수: 14
Azzi Abdelmalek
2013년 8월 23일
post your code
Iain
2013년 8월 23일
Walter Roberson
2013년 8월 23일
Are you able to see the file in the Microsoft File Explorer?
Walter Roberson
2013년 8월 23일
Iain, is the file system mounted over a network, or is it a local disk?
Walter Roberson
2013년 8월 23일
Which version of MATLAB is being used?
dpb
2013년 8월 23일
I'd wonder what the OS dir command returns directly at command line just to ensure it's not an anomaly in the Matlab dir function.
Presuming they're consistent it reverts to how the file was created -- in a Matlab process gone bad or somehow else as to try to pin blame on Matlab or somewhere/somebody else.
Walter Roberson
2013년 8월 24일
WIth some earlier MS Windows versions you might perhaps run out of directory handles.
And
dos('dir dagkgjkajk.his')
returns an information which makes sense (size,date,name)?
dos('dir ...returns the filename, file date and the file size...
Yet
d=dir('dagkgjkajk.his');
d.size
returns empty field(s) even called explicitly over the same access path?
That seems somewhat bizarre but then makes me wonder if there's an embedded null or somesuch other funky thing inside one field of the directory information.
Can you try coding a direct call of the WinAPI and then look at the return structure contents in depth?
Given the description of the process by which the present file came into existence it would seem the two likely candidates for the screwup would be the instrument itself or the transfer to the networked device had a hiccup altho certainly couldn't rule out other points along the way entirely...
Iain
2013년 8월 27일
dpb
2013년 8월 27일
And this does not happen for any other file in the same directory w/ the same access paths, correct?
What if you use the fully-qualified name for this file specifically under the same permutations?
If so, it seems to me it makes the idea of there being hidden character or somesuch anomaly specifically in the information on that one file.
I don't suppose you have a different version of Matlab installed as well to make it convenient to try a second version there to see if can isolate one of Jan's "magic strings" kind of bug in dir()...
Oh, just a thought--what does the string 'J:\....\*.his' expand to for the bogus file info? Does that end up w/ a control character that could somehow be being interpreted incorrectly? I forget for certain, will Win let you try '/' instead of '\' for separators?
Iain
2013년 8월 27일
dpb
2013년 8월 27일
Ok, now, I'm REALLY confused. It has stopped doing it.
Ain't science wonderful!!??? :)
Doncha' just love it when these unexplainable anomalies occur? I'd guess that's as good an explanation as will ever come up with although there was a full moon the other night; that could well have had something to do with it as well...
Keep us posted if it comes/goes again and if there is any resolution other than the aforementioned "Stuff happens..."
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!