From 3fdd8cd74fc8e2ad48b405e5476db5201ef4e46e Mon Sep 17 00:00:00 2001
From: Marco Ratto <marco.ratto@jrc.ec.europa.eu>
Date: Fri, 10 Feb 2012 22:05:51 +0100
Subject: [PATCH] capture the special case when check is not zero but file is
 not found

---
 matlab/parallel/dynareParallelDir.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/matlab/parallel/dynareParallelDir.m b/matlab/parallel/dynareParallelDir.m
index 34aa98846..60c2900ec 100644
--- a/matlab/parallel/dynareParallelDir.m
+++ b/matlab/parallel/dynareParallelDir.m
@@ -40,7 +40,7 @@ for indPC=1:length(Parallel),
             else
                 [check, ax]=system(['ssh ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' ls ',Parallel(indPC).RemoteDirectory,'/',PRCDir,'/',filename]);
             end
-            if check ~ 0;
+            if check ~= 0 || ~isempty(strfind(ax,'No such file or directory'));
                 ax=[];
             end
         else
@@ -50,7 +50,7 @@ for indPC=1:length(Parallel),
                 % It is necessary to capture the ls warning message and properly manage the jolly char '*'!
                 [check ax]=system(['ls ' ,filename, ' 2> OctaveStandardOutputMessage.txt']);
                 
-                if check ~ 0;
+                if check ~= 0 || ~isempty(strfind(ax,'No such file or directory'));
                     ax=[];
                 end
             else
-- 
GitLab