Not sure I understand. These are C functions - the same stuff used under the covers by RPG and every biot as easy to use as any other Service Program function.

There's a fully working example - including error handling here: https://code400.com/forum/forum/iseries-programming-languages/pc-programming-as-it-relates-to-iseries/12893-read-names-of-all-files-in-an-ifs-directory <https://code400.com/forum/forum/iseries-programming-languages/pc-programming-as-it-relates-to-iseries/12893-read-names-of-all-files-in-an-ifs-directory>

And although the RPG style is now a little outdated, Scott Klement's IFS tutorial covers directory processing here: https://www.scottklement.com/rpg/ifs_ebook/dirs.html <https://www.scottklement.com/rpg/ifs_ebook/dirs.html>

I'm providing this information more for others who may come upon this thread later


Jon Paris


On Sep 2, 2021, at 11:57 AM, Maria Lucia Stoppa <mlstoppa@xxxxxxxxx> wrote:

@Jon: it's my hint of API use, which I feel discouraged about because I
would rather reduce the number of technologies in use to the minimum

@Ron: that would be my first choice, which I mentioned in n. 3;
unfortunately IFS_OBJECT_STATISTICS doesn't work for all file systems, as
stated in IBM official documentation and not for QNTC as I have proof of.

Il giorno gio 2 set 2021 alle ore 17:45 Hudson, Ron <RonHudson@xxxxxxxxx>
ha scritto:

Hi Maria,

I'm not sure what didn't work with SQL, but that's how I get a files list
from QNTC.

Originally, I retrieved the list with an listifs function:
Exec SQL Declare Attachments Cursor for
Select PATHNAME, FILENAME, CRTTIME from
table(listifs(trim(:FullDocPath),'*')) as ifs
where filename <> '.' and filename <> '..';

I've switched to using a SQL service:
Exec SQL Declare Attachments Cursor for

Select PATH_NAME, OBJECT_OWNER, CREATE_TIMESTAMP

from table (QSYS2.IFS_OBJECT_STATISTICS(START_PATH_NAME
=>
trim(:FullDocPath),

SUBTREE_DIRECTORIES => 'NO'))

where object_type <> '*DIR';


//Must substring document name from the full PATH_NAME

S2DOC = %subst(S2PATH:%scanr('/':S2PATH)+1);

Hope this helps.


Ron Hudson | Programmer / Analyst
+1.704.752.6513 x1324
www.invue.com
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Maria Lucia Stoppa
Sent: Thursday, September 2, 2021 8:34 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: How to provide an RPG ILE program with a list of files in a QNTC
directory

Hi all,

Hope you are all fine.

For a new RPG ILE procedure, I have to list the content of a directory
defined under QNTC.

The directory is reachable and readable by a specific user and from within
WRKLNK everything works fine.

Now, I am looking for the right technique, or simply the most appropriate,
to list the directory content inside an RPG ILE program.

These are my unsuccessful tries, all executed under the owner control and
authorization:

1. RTVDIRINF DIR('/QNTC/FS1-21/myFolder') -> final files are empty
2. ftp '127.0.0.1' -> ls -l /QNTC/FS1-21/myFolder -> "Path does not
exist"
3. via SQL from TABLE(IFS_OBJECT_STATISTICS) -> explicitly won't work
and I couldn't find a better choice

The only successful try was:
DSPLNK OBJ('/QNTC/FS1-21/myFolder/*') OUTPUT(*PRINT) which obliges me to
read the spool file right after.

I unsuccessfully looked through midrange.com archives and neither was the
IBM official documentation of help.

Is coding using API the only alternative?

Thank you all and have a great day
Lucia

--

Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



--

Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

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