What do you want to read the directory for locating your IFS files ... or
the content of the IFS files?
If you want to read the IFS directories use the IFS_OBJECT_STATISTICS table
function:
https://www.ibm.com/docs/en/i/7.5?topic=services-ifs-object-statistics-table
-function
If you want to read the content you can use the scalar functions:
Get_CLOB_FROM_FILE
Get_BLOB_FROM_FILE
Get_DBCLOB_FROM_FILE
Note: these functions return a Large Object Locator and have to be run under
commitment control.
https://www.ibm.com/docs/en/i/7.5?topic=functions-get-clob-from-file
These functions can be used since release 7.1
Alternatively you can one of the IFS_READ Table functions (IFS_READ,
IFS_READ_BINARY, IFS_READ_UTF8)
https://www.ibm.com/docs/en/i/7.5?topic=is-ifs-read-ifs-read-binary-ifs-read
-utf8-table-functions
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
Modernization ? Education ? Consulting on IBM i
Database and Software Architect
IBM Champion since 2020
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
"Train people well enough so they can leave, treat them well enough so they
don't want to. " (Richard Branson)
"Learning is experience ? everything else is only information!" (Albert
Einstein)
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of gio.cot
via RPG400-L
Sent: Friday, 14 June 2024 15:34
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: gio.cot <gio.cot@xxxxxxxxxxx>
Subject: Use SQL To Read IFS Directories
Hi all
I'm using the program written by Ted Holt at
https://www.itjungle.com/2014/08/27/fhg082714-story02/; i'm finding problems
(i think) when the size file i more than 1 GB. I try to better explain: in
a folder i have 3 files that the size is about more than 2 GB , when i run
SELECT *
FROM table (
rtvdir('/nascloud/XXXX') )
For these file grater than 2 GB, i find null values in the colunms
ACCESSTIME, MODIFYTIME , STATUSTIME etc etc and the side displayed is not
real size
I try to understand the problem reading the source .. possible that the
function "readdir" is obsolete ?
Can some help me to solve this problem
Thanks in advance
FILE SIZE ACCESSTIME MODIFYTIME STATUSTIME NBRLINKS
CCSID CODEPAGE OBJTYPE
QGPL_000000084.ZIP 1223904 <NULL> <NULL> <NULL> <NULL>
<NULL> <NULL> <NULL>
QGPL_000000104.ZIP 1223904 <NULL> <NULL> <NULL> <NULL>
<NULL> <NULL> <NULL>
QGPL_000000105.ZIP 1223904 <NULL> <NULL> <NULL> <NULL>
<NULL> <NULL> <NULL>
QGPL_000000115.ZIP 287695056 2024-06-14 11:38:57.000000 2024-06-14
11:38:57.000000 2024-06-14 11:38:57.000000 1 850 850 *STMF
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.