× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Richard,

The error message points to the third parameter - the file descriptor -
which should be passed by value, not by reference as your fgets prototype
suggests. Try changing the const keyword to value and see what happens.

Best regards,
Carsten Flensburg

----- Original Message ----- 
From: "Richard B Baird" <rbaird@xxxxxxxxxxxxxxxxxxxxx>
To: <rpg400-l@xxxxxxxxxxxx>
Sent: Friday, June 27, 2003 7:48 PM
Subject: fgets() invalid descriptor


> hey all,
>
> here is a very simple program, stripped down to just the basics:
>
> H DFTACTGRP(*NO) ACTGRP(*NEW)
> H BNDDIR('QC2LE')
> H OPTION(*SRCSTMT: *NODEBUGIO: *SHOWCPY)
>
> D waFileName      S            100A
> D count           S             10i 0
> D mode            S              5a
> D errmsg          S            256A
> D wiHandle        S               *
>
> D Buffer          DS
> D   saBuffer                   512A
>
> D fOpen           PR              *   ExtProc('_C_IFS_fopen')
> D  fileName                       *   Value Options(*STRING)
> D  fmode                          *   Value Options(*STRING)
>
> D fgets           PR              *   ExtProc('_C_IFS_fgets')
> D  text                           *   Value options(*string)
> D  length                       10I 0 Value
> D  fd                             *   Const
>
> D geterror        PR            10I 0
> D   peErrMsg                   256A   options(*nopass)
>
> c                   eval      waFileName =
> c                             '/http/aloha/pmix/PMIX2003060401.txt'
>
> c                   eval      mode = 'r' + x'00'
> C                   eval      wiHandle = fOpen(%trim(waFileName):
> c                                             %addr(mode))
>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.