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

File OPEN crashing

NotThatItMatters
Principiante
11.237 Vistas

I have the following line of Fortran code early in my app:

OPEN(UNIT = FILDBGNUM, FILE = FILDBG, STATUS = 'REPLACE')

All arguments are appropriate.  I am getting the error forrtl: severe (602): file not found.

Wait a second.  The STATUS = 'REPLACE'.  How could that error be generated?

0 kudos
30 Respuestas
Steve_Lionel
Colaborador Distinguido III
2.652 Vistas

Just curious - why are you running VS as an administrator? The only time I ever found that necessary was wit VS2005 back in the Windows Vista days. I would be very nervous about doing this, as there’s a lot going on that’s invisible to you.

I’ll try to get a chance to play with this, but I read above that you are opening files in INITIALSETTINGS. I don’t think that’s wise, and it’s not what INITIALSETTINGS is for.

NotThatItMatters
Principiante
2.652 Vistas

The main C# project that governs the Fortran engine we build requires strong keying, and the only way we get that one to run in debug mode is running VS as administrator.  Till now, we have kept the Fortran engine separate, but the move is to incorporate it within the larger project.

Steve_Lionel
Colaborador Distinguido III
2.652 Vistas

I can't reproduce the problem, even running Visual Studio as Administrator.

NotThatItMatters
Principiante
2.652 Vistas

I was afraid of that.  I have noted curious errors like this in the past.  Perhaps something is not quite installed properly, or an old installation is breaking something new.

I will make a point to uninstall everything on the machine and try again.  I am very sorry to have caused all this trouble.  I would like to make this work, but this seems to be way above my pay grade.

Steve_Lionel
Colaborador Distinguido III
2.652 Vistas

Here's a question - is the path to your project under the Windows or Program Files folders?

IanH
Colaborador Distinguido III
2.652 Vistas

Note that the "impersonation" associated with running as an administrator can change things such as how drives map across to file systems. Files and directories that the non-administrator user might see may not be the same as those the administrator might see.

Steve_Lionel
Colaborador Distinguido III
2.652 Vistas

Oh, and do you get the same behavior if you run the program as Administrator directly (not inside VS)?

NotThatItMatters
Principiante
2.652 Vistas

The app is run in C:\Users\MyName\Documents\...  The "impersonation" indeed might be a problem; I am looking into it.  Running the app as Administrator in a Command Prompt window yields precisely the same trouble.

NotThatItMatters
Principiante
2.652 Vistas

The impersonation is the problem.  Running the file as administrator will work, so long as the file itself is local.  When the file is on a network drive, administrator privilege loses track of it for some reason.

NotThatItMatters
Principiante
2.652 Vistas

So here is the problem:

https://support.microsoft.com/en-us/help/3035277/mapped-drives-are-not-available-from-an-elevated-prompt-when-uac-is-co

The problem does not lie with Fortran at all, although the error reporting is a little suspect.  This item should be closed.

Responder