Changeset 266 for trunk/src


Ignore:
Timestamp:
Nov 8, 2011, 1:26:19 PM (12 years ago)
Author:
sommeria
Message:

bug on file rights fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r265 r266  
    25152515if isequal(subdir_civ1,''),subdir_civ1='CIV'; end% put default subdir
    25162516if isequal(subdir_civ2,''),subdir_civ2=subdir_civ1; end% put default subdir
    2517 currentdir=pwd;%store the current working directory
     2517% currentdir=pwd;%store the current working directory
    25182518[Path_ima,Name]=fileparts(filebase);%Path of the image files (.civ)
    25192519if ~exist(Path_ima,'dir')
     
    25262526    msgbox_uvmat('ERROR',['No writting access to ' Path_ima])
    25272527    filecell={};
    2528     cd(currentdir);
     2528%     cd(currentdir);
    25292529    return
    25302530end
     
    25702570                return
    25712571            elseif isunix         
    2572                 [xx,msg2] = fileattrib(subdir_civ1_new,'+w','g'); %yield writing access (+w) to user group (g)
     2572                [xx,msg2] = fileattrib(fullfile(Path_ima,subdir_civ1_new),'+w','g'); %yield writing access (+w) to user group (g)
    25732573                if ~strcmp(msg2,'')
    2574                     msgbox_uvmat('ERROR',['pb of permission for  ' subdir_civ1_new ': ' msg2])%error message for directory creation
     2574                    msgbox_uvmat('ERROR',['pb of permission for  ' fullfile(Path_ima,subdir_civ1_new) ': ' msg2])%error message for directory creation
    25752575                    filecell={};
    25762576                    return
     
    26132613                    return
    26142614                else
    2615                     [xx,msg2] = fileattrib(subdir_civ1_new,'+w','g'); %yield writing access (+w) to user group (g)
     2615                    [xx,msg2] = fileattrib(fullfile(Path_ima,subdir_civ1_new),'+w','g'); %yield writing access (+w) to user group (g)
    26162616                    if ~strcmp(msg2,'')
    26172617                        msgbox_uvmat('ERROR',['pb of permission for ' subdir_civ1_new ': ' msg2])%error message for directory creation
     
    26392639            msgbox_uvmat('ERROR',[filecell.ima1.civ1{ifile,indexj} ' not found'])
    26402640            filecell={};
    2641             cd(currentdir)
     2641           % cd(currentdir)
    26422642            return
    26432643        end
     
    26462646            msgbox_uvmat('ERROR',[filecell.ima2.civ1{ifile,indexj} ' not found'])
    26472647            filecell={};
    2648             cd(currentdir)
     2648            %cd(currentdir)
    26492649            return
    26502650        end
     
    26642664                msgbox_uvmat('ERROR',[filecell.imaA1.civ1{ifile,indexj} ' not found'])
    26652665                filecell={};
    2666                 cd(currentdir)
     2666               % cd(currentdir)
    26672667                return
    26682668            end
     
    26712671                msgbox_uvmat('ERROR',[filecell.imaA2.civ1{ifile,indexj} ' not found'])
    26722672                filecell={};
    2673                 cd(currentdir)
     2673               % cd(currentdir)
    26742674                return
    26752675            end
     
    26872687                msgbox_uvmat('ERROR',[filename ' not found'])
    26882688                filecell={};
    2689                 cd(currentdir)
     2689               % cd(currentdir)
    26902690                return
    26912691            end
     
    27032703                    set(handles.RUN,'BackgroundColor',[1 0 0])
    27042704                    filecell={};
    2705                     cd(currentdir)
     2705                    %cd(currentdir)
    27062706                    return
    27072707                end
     
    27442744        if ~exist(fullfile(Path_ima,subdir_civ2_new),'dir')
    27452745            [xx,m2]=mkdir(fullfile(Path_ima,subdir_civ2_new));
    2746             [xx,msg2] = fileattrib(subdir_civ2_new,'+w','g'); %yield writing access (+w) to user group (g)
     2746            [xx,msg2] = fileattrib(fullfile(Path_ima,subdir_civ2_new),'+w','g'); %yield writing access (+w) to user group (g)
    27472747            if ~isequal(m2,'')
    2748                 msgbox_uvmat('ERROR',['cannot create ' subdir_civ2_new ': ' m2])
     2748                msgbox_uvmat('ERROR',['cannot create ' fullfile(Path_ima,subdir_civ2_new) ': ' m2])
    27492749                filecell={};
    2750                 cd(currentdir)
     2750               % cd(currentdir)
    27512751                return
    27522752            end
     
    27792779            if ~exist(fullfile(Path_ima,subdir_civ2_new),'dir')
    27802780                [xx,m2]=mkdir(subdir_civ2_new);
    2781                  [xx,msg2] = fileattrib(subdir_civ2_new,'+w','g'); %yield writing access (+w) to user group (g)
     2781                 [xx,msg2] = fileattrib(fullfile(Path_ima,subdir_civ2_new),'+w','g'); %yield writing access (+w) to user group (g)
    27822782                if ~isequal(m2,'')
    2783                     msgbox_uvmat('ERROR', ['cannot create ' subdir_civ2_new ': ' m2])%error message for directory creation
    2784                     cd(currentdir)
     2783                    msgbox_uvmat('ERROR', ['cannot create ' fullfile(Path_ima,subdir_civ2_new) ': ' m2])%error message for directory creation
     2784                  %  cd(currentdir)
    27852785                    filecell={};
    27862786                    return
     
    27912791    subdir_civ2=subdir_civ2_new;
    27922792end
    2793 cd(currentdir);%come back to the current working directory
     2793%cd(currentdir);%come back to the current working directory
    27942794
    27952795%%%%%%%%%%%%%  if civ2 results are obtained or used  %%%%%%%%%%%%%
Note: See TracChangeset for help on using the changeset viewer.