All attempts to open a file assigned to LPT1 or LPT2 result in "libcob: permanent file error (status = 30) file: 'LPT1' ]or 'LPT2']". The following sample program will illustrate the problem. (I'm using GC30r2793-VBI-rename-7z-to-exe.exe. I cannot use GC31 because it ignores highlight, amonst other problems.)
Please ignore and/or delete this post. The problem was that the "net use" assignment for LPT1 and LPT2 was somehow deleted, so Windoze was unaware of their existence. Still, a file system error 92 would have made more sense, and isolated the problem more quickly.
Last edit: cdg 2019-09-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
92=File not found (with Realia Cobol), which is the closest code for this situation (since it couldn't find LPT1/2). I wasn't aware that the 9x codes vary with the compiler.
Last edit: cdg 2019-09-23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually for this value the defined i-o-status would be either status 35 or 37. Quoting from ANSI85 (identical in COBOL 2002 and likely also identical for later revisions):
I-O status = 35. A permanent error exists because an OPEN statement with the INPUT, I-O, or EXTEND phrase is attempted on a file that is not described as optional and the physical file is not present.
I-O status = 37. A permanent error exists because an OPEN statement is attempted on a file and that file will not support the open mode specified in the OPEN statement [...]EXTEND or OUTPUT phrase [...] but the file will not support write operations.
This is actually what is returned by GnuCOBOL if the underlying C runtime reports there is no access possible. The fallback for any fatal error is:
I-O status = 30. A permanent error exists and no further information is available concerning the input-output operation.
I've just rechecked: this happens in your LPT2-case because the C function access() says "everything is fine "file" can be accessed" and the following fopen() with requested "write" mode reports "ENOENT: 2 - No such file or directory"; this combination is more than strange and "file not found" for OPEN-OUTPUT sounds wrong, too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All attempts to open a file assigned to LPT1 or LPT2 result in "libcob: permanent file error (status = 30) file: 'LPT1' ]or 'LPT2']". The following sample program will illustrate the problem. (I'm using GC30r2793-VBI-rename-7z-to-exe.exe. I cannot use GC31 because it ignores highlight, amonst other problems.)
libcob: permanent file error (status = 30) file: 'LPT1'
Last edit: Simon Sobisch 2019-09-23
Please ignore and/or delete this post. The problem was that the "net use" assignment for LPT1 and LPT2 was somehow deleted, so Windoze was unaware of their existence. Still, a file system error 92 would have made more sense, and isolated the problem more quickly.
Last edit: cdg 2019-09-22
What is an error 92 (all 9x are implementor defined)?
92=File not found (with Realia Cobol), which is the closest code for this situation (since it couldn't find LPT1/2). I wasn't aware that the 9x codes vary with the compiler.
Last edit: cdg 2019-09-23
Actually for this value the defined i-o-status would be either status 35 or 37. Quoting from ANSI85 (identical in COBOL 2002 and likely also identical for later revisions):
I-O status = 35. A permanent error exists because an
OPENstatement with theINPUT,I-O, orEXTENDphrase is attempted on a file that is not described as optional and the physical file is not present.I-O status = 37. A permanent error exists because an
OPENstatement is attempted on a file and that file will not support the open mode specified in theOPENstatement [...]EXTENDorOUTPUTphrase [...] but the file will not support write operations.This is actually what is returned by GnuCOBOL if the underlying C runtime reports there is no access possible. The fallback for any fatal error is:
I-O status = 30. A permanent error exists and no further information is available concerning the input-output operation.
I've just rechecked: this happens in your LPT2-case because the C function
access()says "everything is fine "file" can be accessed" and the followingfopen()with requested "write" mode reports "ENOENT: 2 - No such file or directory"; this combination is more than strange and "file not found" forOPEN-OUTPUTsounds wrong, too.