From 051d155058ff7fdfd7d69a66827cf15aac6c0e6a Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 7 Feb 2017 14:31:11 +0000 Subject: [PATCH] Try up to three times to open 'decoded.txt". git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7559 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/decoder.f90 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/decoder.f90 b/lib/decoder.f90 index d4e75e3a5..b5e83701f 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -68,13 +68,23 @@ subroutine multimode_decoder(ss,id2,params,nfsample) nz=min(NTMAX*12000,kbad+100) ! id2(1:nz)=0 ! temporarily disabled as it can breaak the JT9 decoder, maybe others endif - - if (params%nagain) then - open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', & - position='append') + + nfail=0 +10 if (params%nagain) then + open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', & + position='append',iostat=ios) else - open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown') + open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', & + iostat=ios) end if + if(ios.ne.0) then + nfail=nfail+1 + if(nfail.le.3) then + call sleep_msec(100) + go to 10 + endif + endif + if(params%nmode.eq.4 .or. params%nmode.eq.65) open(14,file=trim(temp_dir)// & '/avemsg.txt',status='unknown') if(params%nmode.eq.164) open(17,file=trim(temp_dir)//'/red.dat', &