S
scottmf
Running windows XP:
I am using perl to run multiple simultaneous instances of the same
fortran program. The fortran program parses 2 files, one of which is
common between the two instances, i.e.
fortran1 file1.dat file2.dat
fortran2 file1.dat file3.dat
when I run the processes I get the error:
forrtl: The process cannot access the file because it is being used by
another process.
forrtl: severe (30): open failure, unit 24, file file1.dat
I do not have access to the fortran source, but the developer tells me
that the open call does not lock the file for reading, and if I run
each instance of the program from different machines on a network there
are no errors.
Here is the Perl code I am using to call the processes:
use strict;
use Win32:rocess;
use Win32;
my ($proc1, $proc2);
Win32:rocess::Create($proc1,
"C:\\Software\\fortran.bat",
"fortran test1.dat",
0,
NORMAL_PRIORITY_CLASS,
".") || die ERRORREPORT();
Win32:rocess::Create($proc2,
"C:\\Software\\fortran.bat",
"fortran test2.dat",
0,
NORMAL_PRIORITY_CLASS,
".") || die ERRORREPORT();
sub ErrorReport{
print Win32::FormatMessage( Win32::GetLastError() );
}
Any ideas on what is happening or whether I need to fix the problem in
my perl code or the fortran?
I am using perl to run multiple simultaneous instances of the same
fortran program. The fortran program parses 2 files, one of which is
common between the two instances, i.e.
fortran1 file1.dat file2.dat
fortran2 file1.dat file3.dat
when I run the processes I get the error:
forrtl: The process cannot access the file because it is being used by
another process.
forrtl: severe (30): open failure, unit 24, file file1.dat
I do not have access to the fortran source, but the developer tells me
that the open call does not lock the file for reading, and if I run
each instance of the program from different machines on a network there
are no errors.
Here is the Perl code I am using to call the processes:
use strict;
use Win32:rocess;
use Win32;
my ($proc1, $proc2);
Win32:rocess::Create($proc1,
"C:\\Software\\fortran.bat",
"fortran test1.dat",
0,
NORMAL_PRIORITY_CLASS,
".") || die ERRORREPORT();
Win32:rocess::Create($proc2,
"C:\\Software\\fortran.bat",
"fortran test2.dat",
0,
NORMAL_PRIORITY_CLASS,
".") || die ERRORREPORT();
sub ErrorReport{
print Win32::FormatMessage( Win32::GetLastError() );
}
Any ideas on what is happening or whether I need to fix the problem in
my perl code or the fortran?