Changeset 22169


Ignore:
Timestamp:
10/12/17 14:45:29 (7 years ago)
Author:
Mathieu Morlighem
Message:

CHG: better way of dealing with warnings

Location:
issm/trunk/src/m/os
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/os/issmbbftpin.m

    r20500 r22169  
    1010
    1111%first be sure packages are not in the current directory, this could conflict with pscp on windows.
    12 %get initial warning mode
    13 state=warning('query', 'all');
    14 %remove warnings in case the files do not exist
    15 warning off
    1612for i=1:numel(packages),
    17         delete(packages{i});
     13        if exist(packages{i},'file'),
     14                delete(packages{i});
     15        end
    1816end
    19 %back to initial warning state
    20 warning(state);
    2117
    2218%if hostname and host are the same, do a simple copy
     
    3127        %build a string of the type: bbftp -s -u elarour -e 'setnbstream 8; cd /nobackupp10/elarour/Testing/Interactive3/; get Antarctica.outbin' pfe1.nas.nasa.gov
    3228        command=['!bbftp -s -V -u ' login ' -e ''setnbstream 8; cd ' path '; '];
    33         for i=1:length(packages),
     29        for i=1:numel(packages),
    3430                command=[command 'get ' packages{i} ';'];
    3531        end
     
    4036        %check bbftp worked
    4137        for i=1:numel(packages),
    42                 if ~exist(['./' packages{i}]),
     38                if ~exist(['./' packages{i}],'file'),
    4339                        error('scpin error message: could not call scp on *nix system');
    4440                end
    4541        end
    46 
    4742end
  • issm/trunk/src/m/os/issmscpin.m

    r13975 r22169  
    1010
    1111%first be sure packages are not in the current directory, this could conflict with pscp on windows.
    12 %get initial warning mode
    13 state=warning('query', 'all');
    14 %remove warnings in case the files do not exist
    15 warning off
    1612for i=1:numel(packages),
    17         delete(packages{i});
     13        if exist(packages{i},'file'),
     14                delete(packages{i});
     15        end
    1816end
    19 %back to initial warning state
    20 warning(state);
    2117
    2218%if hostname and host are the same, do a simple copy
     
    5046
    5147        else
    52                 %just use standard unix scp
    53                 %string to copy multiple files using scp:
     48                %just use standard unix scp string to copy multiple files using scp:
    5449                if numel(packages)==1,
    5550                        string=packages{1};
Note: See TracChangeset for help on using the changeset viewer.