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



I've tried that with no success...

Thanks,
T





David Gibbs
<david@xxxxxxxxxx
om> To
Sent by: RPG programming on the AS400 /
rpg400-l-bounces@ iSeries <rpg400-l@xxxxxxxxxxxx>
midrange.com cc

Subject
2008-09-29 17:17 Re: stat API


Please respond to
RPG programming
on the AS400 /
iSeries
<rpg400-l@midrang
e.com>






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

--
IBM i on Power - For when you can't afford to be out of business
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




This communication and any transmitted documents are intended to be confidential. If there is a problem with this transmission, please contact the sender. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.

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.