gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] File IO error handling


From: Roger While
Subject: [open-cobol-list] File IO error handling
Date: Mon Sep 27 22:38:20 2004

Hi Keisuke,
We discussed (1) some months ago.

1)
In the case of a serious error on the OPEN statement,
we need to terminate the program. (Otherwise the
program may loop)

Currently I have these corrections to achieve this :
Prime IO exceptions ->
In typeck.c after line 2552
    CB_EXCEPTION_ENABLE (COB_EC_I_O) = 1;
Bomb out after error ->
In codegen.c replace line 2159 ("break;") with
    exit(1);

Maybe we should exit with file status or errno.
Note the above does not affect any USE statements
in DECLARATIVES which will still work as intended.

2)
The problem with OPEN OPTIONAL EXTEND reported on the list
needs something like this :
In fileio.c after line 1069
   if ( mode == COB_OPEN_EXTEND )
      RETURN_STATUS (COB_STATUS_30_PERMANENT_ERROR);

Problem is that ENOENT can also mean error in path name

3)
In numeric.c we seem to be missing some checks on
!flag_binary_truncate
(IIRC, you have my mods)

Roger While




reply via email to

[Prev in Thread] Current Thread [Next in Thread]