× 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.



On Mon, Sep 29, 2008 at 3:59 PM, <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.
Any pointers are appreciated.

Thanks,
T



I have a utility to print the contents of the IFS
in varying sequences that uses 'stat'

www.brilligware.com/cp1240.html


Selected details:

d lstat pr 10i 0 ExtProc('stat')
d * Value
d * Value

*
* file status information
*
d fStat ds 128
d fStatDat 29 32i 0
d fStatSiz 45 48i 0
d fStatTyp 49 58a

* ... standalone variables ...
d fStat@ s * Inz(%Addr(fStat))


lstat( %Addr(pmpath) : fStat@ );
objTyp = fStatTyp;
objDat = fStatDat;
objSiz = fStatSiz;

pmpath is a string (null (x'00') terminated character
variable) containing the path name.

HTH

Chris
---
www.brilligware.com
Home of MineSweeper 5250

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.