2011-05-04 10:21:25 +02:00
|
|
|
function [NewFilesFrom, NewFileList]=dynareParallelFindNewFiles(FileList,Parallel, PRCDir)
|
|
|
|
|
|
|
|
% PARALLEL CONTEXT
|
|
|
|
% In a parallel context, this function checks if in 'dirName' and its sub-directory
|
|
|
|
% there are other files in addition to 'FileList'.
|
|
|
|
% If 'Yes' the variable 'NewFiles' is a list of these file.
|
|
|
|
%
|
|
|
|
%
|
|
|
|
% INPUTS
|
|
|
|
% o dirName [] ...
|
2011-05-10 10:07:18 +02:00
|
|
|
% o Parallel [] ...
|
|
|
|
% o PRCDir [] ...
|
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
% OUTPUTS
|
2011-05-10 10:07:18 +02:00
|
|
|
% o NewFilesFrom [] ...
|
|
|
|
% o NewFileList [] ...
|
2011-05-04 10:21:25 +02:00
|
|
|
%
|
2022-04-13 13:15:19 +02:00
|
|
|
% Copyright © 2009-2017 Dynare Team
|
2011-05-04 10:21:25 +02:00
|
|
|
%
|
|
|
|
% This file is part of Dynare.
|
|
|
|
%
|
|
|
|
% Dynare is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
%
|
|
|
|
% Dynare is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
%
|
|
|
|
% You should have received a copy of the GNU General Public License
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2011-05-04 10:21:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
NewFilesFrom={};
|
|
|
|
|
|
|
|
LfL=length(FileList);
|
2017-05-16 15:10:20 +02:00
|
|
|
% The first call ...
|
2011-05-04 10:21:25 +02:00
|
|
|
NewFileList = dynareParallelListAllFiles('Root',PRCDir,Parallel);
|
|
|
|
|
|
|
|
|
|
|
|
LnFl=length(NewFileList);
|
|
|
|
|
|
|
|
RelativePosition=1;
|
|
|
|
|
|
|
|
for i=1:LnFl
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
% Exception Handling
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
% If you comment the code below all new file will be copied!
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
% 1. The comp_status* files are managed separately.
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
FiCoS=strfind(NewFileList{i},'comp_status_');
|
|
|
|
if ~isempty(FiCoS)
|
|
|
|
continue
|
|
|
|
end
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
% 2. For the time being is not necessary to always copy *.log
|
|
|
|
% and *.txt files.
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
nC1 = strfind(NewFileList{i}, '.log');
|
|
|
|
nC2 = strfind(NewFileList{i}, '.txt');
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
if (~isempty(nC1) || ~isempty(nC2))
|
|
|
|
continue
|
|
|
|
end
|
2017-05-16 15:10:20 +02:00
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2017-05-16 15:10:20 +02:00
|
|
|
|
|
|
|
|
2011-05-04 10:21:25 +02:00
|
|
|
N=strmatch(NewFileList{i},FileList,'exact');
|
|
|
|
if isempty(N)
|
|
|
|
NewFilesFrom{RelativePosition}=NewFileList{i};
|
|
|
|
RelativePosition=RelativePosition+1;
|
|
|
|
end
|
|
|
|
end
|