Menu

#249 Provide configuration for returning error codes for fileio system library calls

GC 4.x
accepted
nobody
5 - default
2024-07-23
2017-11-01
No

MF documents

If any of the routines

  • CBL_CHECK_FILE_EXIST
  • CBL_COPY_FILE
  • CBL_CREATE_FILE
  • CBL_DELETE_FILE
  • CBL_OPEN_FILE
  • CBL_READ_FILE
  • CBL_RENAME_FILE
  • CBL_WRITE_FILE
  • CBL_CHANGE_DIR
  • CBL_CREATE_DIR
  • CBL_DELETE_DIR
  • CBL_READ_DIR

fails, the RETURN-CODE register contains a file status value indicating the failure. This file status is always the standard ANSI'74 file status value. If no ANSI'74 file status is defined for the error, an extended file status is returned (9/nnn where nnn is the run-time system error number).

While ACUCOBOL documents:

Returns "0" if successful, or "1" if not.

And GnuCOBOL libcob/fileio.c does (in most cases):

Returns "0" if successful, or "-1" if not

Not checked what other compilers do...

This should be changable via compiler configuration flags.

Discussion

  • Simon Sobisch

    Simon Sobisch - 2024-07-23
    • labels: --> fileio, mf-cobol, acucobol
    • Group: unclassified --> GC 4.x
     
    • Vincent (Bryan) Coen

      Let me know when available & working with the docs for all and I will
      put in the manuals PG & PR.

      On 23/07/2024 20:27, Simon Sobisch wrote:

      • labels: --> fileio, mf-cobol, acucobol
      • Group: unclassified --> GC 4.x
      • Comment:

      This is related to configurable io status [feature-requests:#348]
      https://sourceforge.net/p/gnucobol/feature-requests/348/ which is
      loosely planned for GC 4.0

       

      Related

      Wish List: #348

  • Simon Sobisch

    Simon Sobisch - 2024-07-23

    This is related to configurable io status [feature-requests:#348] which is loosely planned for GC 4.0

     

    Related

    Wish List: #348


Log in to post a comment.