Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

running in batch mode

Deleted_U_Intel
Employee
421 Views

Why do I sometimes (up to 33%) get the following message when running my *.exe file in batch mode: "The system can not find the file specified". The output from my exe file is o.dat. I am running this batch file in the dos window on my system for which the operating system is VISTA. A segment of the batch file is below:
@echo off
rem ***********************************
rem this batch file is for running multiples
rem of penetration curves
rem ***********************************
del o*.dat
rem ***********************************
rem ************STARTING CYCLE 1*******
time/t
start /wait PHEV_BATCH
ren o.dat o1.dat
echo done with cycle 1
rem goto end
rem ***********************************

It seems that sometimes the system, despite the /wait switch, is getting out ahead of the application before it has completed writing out the o.dat file.

Your suggestions would be appreciated.

thank you!

John

0 Kudos
2 Replies
jimdempseyatthecove
Honored Contributor III
422 Views

John,

When you receive the error message does o.dat exist?

If it does not exist then PHEV_BATCH did not create the file (or created it in a different directory than which you expected).

If it does exist (where it is expected) then this may be a lazy close issue. Try

start /wait PHEV_BATCH
:wait
if not exist o.dat goto wait
ren o.dat o1.dat

The above will hang if o.dat is not created. Consider the following

start /wait PHEV_BATCH
if not exist o.dat DIR >NULL
if not exist o.dat DIR >NULL
if not exist o.dat DIR >NULL
if not exist o.dat echo o.dat not found
if not exist o.dat ren o.dat o1.dat


Jim Dempsey


0 Kudos
jimdempseyatthecove
Honored Contributor III
422 Views

I hope you caught the error in the last statement (remove the "not")

Jim
0 Kudos
Reply