Changeset 1037 for trunk/src/dir_uvmat.m
- Timestamp:
- May 1, 2018, 4:31:01 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dir_uvmat.m
r1033 r1037 27 27 %======================================================================= 28 28 29 function [ ListFiles] = dir_uvmat(DirName) 29 function [ ListFiles,errormsg] = dir_uvmat(DirName) 30 errormsg=''; 30 31 if regexp(DirName,'^http://') 31 32 catalog=[DirName,'/catalog.xml']; 33 try 32 34 str=urlread(catalog); 33 ListFiles=(regexp(str,'xlink:title="(?<name>[^"]+)"','names'))'; 35 catch ME 36 ListFiles=[]; 37 errormsg=ME.message; 38 return 39 end 40 ListFiles=(regexp(str,'xlink:title="(?<name>[^"]+)"','names'))';%list subfolders 34 41 NumDir=numel(ListFiles); 35 ListFiles=[ListFiles;(regexp(str,'dataset name="(?<name>[^"]+)"','names'))']; 42 ListFiles=[ListFiles;(regexp(str,'dataset name="(?<name>[^"]+)"','names'))'];% append files to the list 36 43 for ilist=1:numel(ListFiles) 37 44 ListFiles(ilist).date=0; … … 43 50 ListFiles(ilist).isdir=true; 44 51 end 52 ListFiles(NumDir+1)=[]; 45 53 else 46 54 ListFiles=dir(DirName);
Note: See TracChangeset
for help on using the changeset viewer.