Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
62 Views

error in open in 2018 upd 2

Jump to solution
I'm getting an error during execution on an open statement. There are two files and the first does exist while the second does not. 
The code segment follows:
C:\Users\Brooks\Desktop\Stats\Stats.txt
C:\Users\Brooks\Desktop\Stats\PRN.dat

forrtl: severe (29): file not found, unit 3, file \\.\PRN
Image              PC        Routine            Line        Source
libifcoremdd.dll   519D2617  Unknown               Unknown  Unknown
libifcoremdd.dll   519F9190  Unknown               Unknown  Unknown
MyStats.exe        0032F1BF  _MAIN__                    51  MyStats.f90
MyStats.exe        003354D3  Unknown               Unknown  Unknown
MyStats.exe        0033873E  Unknown               Unknown  Unknown
MyStats.exe        00338620  Unknown               Unknown  Unknown
MyStats.exe        003384CD  Unknown               Unknown  Unknown
MyStats.exe        00338758  Unknown               Unknown  Unknown
KERNEL32.DLL       759A8654  Unknown               Unknown  Unknown
ntdll.dll          77B64B17  Unknown               Unknown  Unknown
ntdll.dll          77B64AE7  Unknown               Unknown  Unknown

Code Segment:

    fName1 = "C:\Users\Brooks\Desktop\Stats\Stats.txt"
    write(6,*) fName1
    open (unit=2,file=fName1,status='REPLACE',form='FORMATTED',action="WRITE")
    rewind 2
    fName2 = "C:\Users\Brooks\Desktop\Stats\PRN.dat"
    write(6,*) fName2
    open (unit=3,file=fName2,status='REPLACE',form='FORMATTED',action="WRITE")  <=== Line 51

 

When status="REPLACE" I thought if the file does not exist then it creates one; but it bombs me out instead.

Thanks,

Brooks

0 Kudos

Accepted Solutions
Highlighted
Black Belt
62 Views

PRN, LPT, COM1, COM2, CON are examples of special files, which are tied to devices with specific properties. You cannot have a file name that clashes with these dedicated names.

View solution in original post

0 Kudos
4 Replies
Highlighted
New Contributor I
62 Views

I'm running Win 10 x64 on an Intel i7 with 32GB RAM and 1 TB disk.

0 Kudos
Highlighted
Black Belt
63 Views

PRN, LPT, COM1, COM2, CON are examples of special files, which are tied to devices with specific properties. You cannot have a file name that clashes with these dedicated names.

View solution in original post

0 Kudos
Highlighted
New Contributor I
62 Views

Thanks very much. Did not know that.

Brooks

0 Kudos
Highlighted
New Contributor I
62 Views

Thanks very much. Did not know that.

Brooks

0 Kudos