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
Beginner
2,131 Views

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 Replies
Steve_Lionel
Honored Contributor III
554 Views

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.

0 Kudos
NotThatItMatters
Beginner
554 Views

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.

0 Kudos
Steve_Lionel
Honored Contributor III
554 Views

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

0 Kudos
NotThatItMatters
Beginner
554 Views

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.

0 Kudos
Steve_Lionel
Honored Contributor III
554 Views

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

0 Kudos
IanH
Honored Contributor II
554 Views

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.

0 Kudos
Steve_Lionel
Honored Contributor III
554 Views

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

0 Kudos
NotThatItMatters
Beginner
554 Views

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.

0 Kudos
NotThatItMatters
Beginner
554 Views

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.

0 Kudos
NotThatItMatters
Beginner
554 Views

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.

0 Kudos
Reply