Thursday, November 3, 2011

Remove the .DS_Store from the file list

Sometimes, working on the filelist is troublesome because of the .DS_Store

WhereAqua = pwd;

files = dir(WhereAqua);

% Remove the '.DS_Store' from the list
if strcmp(files(3).name, '.DS_Store')
files(3) = []
end


There is another way too!
fileLIST = dir;
N = length(fileLIST); % fileLIST.name
 status = mkdir(pwd, 'hdfClass'); 

if exist('.DS_Store','file')
! rm .DS_Store
fn =  fileLIST(4).name;
else
fn =  fileLIST(3).name;  

-->

No comments: