TAllen@xxxxxxxxxxxx wrote:
Could someone please provide a working sample of using the stat API in an
RPG program? I've tried everything and the return code is always -1. All
other API calls (open file, read, etc.) work fine. My hunch is that the
trailing spaces in the file name are causing the problem buut I don't know
how to get around that. RPG is not my strong suit.

IIRC, the stat api requires the file name to be terminated with a null byte x'00'.

try: filename = %trim(filename) + x'00'

FWIW: I was just digging into a problem with the stat api and a file who's name had a trailing blank in it. Confused the hell out our program that trimmed the trailing blanks and added the null.

david


This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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.