Changeset 218


Ignore:
Timestamp:
Mar 9, 2011, 10:50:25 PM (14 years ago)
Author:
sommeria
Message:

write data in a new directory .0 if the selected output directory exists

Location:
trunk/src/series
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/aver_stat.m

    r190 r218  
    283283end
    284284
    285 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
     285%% Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
    286286subdir_result='aver_stat';
    287 if ~exist(fullfile(RootPath{1},subdir_result),'dir')
    288     dircur=pwd; %record current working directory
    289     cd(RootPath{1})% goes to the iamge directory
    290     [m1,m2,m3]=mkdir(subdir_result);
    291     if ~isequal(m2,'')
    292          msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation
    293     end
    294     [xx,msg2] = fileattrib(subdir_result,'+w','g'); %yield writing access (+w) to user group (g)
    295     if ~strcmp(msg2,'')
    296         msgbox_uvmat('ERROR',['pb of permission for ' subdir_result ': ' msg2])%error message for directory creation
    297         cd(curdir)
    298         return
    299     end
    300     cd(dircur) %back to the initial working directory
     287pathdir=fullfile(RootPath{1},subdir_result);
     288while exist(pathdir,'dir')
     289    subdir_result=[subdir_result '.0'];
     290    pathdir=fullfile(RootPath{1},subdir_result);
     291end
     292[m1,m2,m3]=mkdir(pathdir);
     293if ~isequal(m2,'')
     294     msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation
     295end
     296[xx,msg2] = fileattrib(pathdir,'+w','g'); %yield writing access (+w) to user group (g)
     297if ~strcmp(msg2,'')
     298    msgbox_uvmat('ERROR',['pb of permission for ' pathdir ': ' msg2])%error message for directory creation
     299    return
    301300end
    302301filebase_out=filebase{1};
     
    309308end
    310309
    311 %slice loop
     310%% slice loop
    312311siz=size(num_i1{1});
    313312lengthtot=siz(1)*siz(2);
  • trunk/src/series/time_series.m

    r190 r218  
    237237pathdir=fullfile(RootPath{1},subdir_result);
    238238while exist(pathdir,'dir')
    239     pathdir=[pathdir '.0'];
     239    subdir_result=[subdir_result '.0'];
     240    pathdir=fullfile(pathdir,subdir_result);
    240241end
    241242[m1,m2,m3]=mkdir(pathdir);
     
    245246[xx,msg2] = fileattrib(pathdir,'+w','g'); %yield writing access (+w) to user group (g)
    246247if ~strcmp(msg2,'')
    247     msgbox_uvmat('ERROR',['pb of permission for ' subdir_result ': ' msg2])%error message for directory creation
     248    msgbox_uvmat('ERROR',['pb of permission for ' pathdir ': ' msg2])%error message for directory creation
    248249    return
    249250end
Note: See TracChangeset for help on using the changeset viewer.