From an RPG or CL program, is there a way to determine the size of a
particular file in the IFS.
Thanks
Col
From ILE RPG or CL, you can call the stat() function:
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/stat.htm
From other threads on this newsgroup, I believe the biggest challenge
(in RPG) is to create a prototype for calling it. The C language
definitions can be found in QSYSINC/SYS(STAT) .. there are actually a
number of similar "stat" functions - fstat, fstat64, etc, and I don't
pretend to understand the differences. I believe there is a Redbook
showing how to create RPG prototypes for APIs .. perhaps this one:
http://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/a555adfe471ddb288625677c006176c0?OpenDocument&Highlight=0,rpg
--
Karl Hanson
You can do a DSPLNK to *PRINT, then read the spool file for the
appropriate prompt and value for each and every attribute for which
you desire information. With DSPLNK you can get attributes for one
object in a directory, all objects, or those objects obeying the
object-type and/or name pattern you use in the command. You'll end up
with one spool file for each DSPLNK command you execute. Your program
can delete them too.
There is an IBM bug: if you select > c. 1600 objects from a directory
for detailed (*EXTENDED in the DSPLNK command) attributes, the spool
file will have the names of all the objects, but the detailed
attributes for only the LAST c. 1600 objects (last alphabetically).
We were told, in April, that there were no plans to correct this bug
(in Version 4?).
Oddly, I myself just posted a question regarding the Qp01GetAttr()
Unix-type API this very day (I was using DSPLNK but now need to do up
to 40,000 objects in a directory). It is another way to get
attributes of IFS objects. See the System API Reference, but only if
you are familiar with bumping your way thru an array using offsets and
sizes present in the array itself...
"Karl Hanson" <kcha...@us.ibm.com> wrote in message
news:3D109A37...@us.ibm.com...
"Jack Liesner" <jlie...@att.net> wrote in message
news:b31829b6.02061...@posting.google.com...
IBM is giving out (for free) a savefile called IFS tools.
The IFS tools can be downloaded from
ftp://testcase.boulder.ibm.com/as400/fromibm/ApiSamples/ifstool.savf
It contains one interesting program called QRYIFSLIB.
This can be called in a number of ways from CL or whatever
and it produces a nice outfile with a lot of fields (size etc.).
The program has a strange "bug" (can not handle IFS objects
larger than 2 GB) and needs to be modified for this. If someone
would like to have the modified source, just send me a mail.
-
Bengt
"Jack Liesner" <jlie...@att.net> skrev i meddelandet
news:b31829b6.02061...@posting.google.com...
>IBM is giving out (for free) a savefile called IFS tools.
>The IFS tools can be downloaded from
>ftp://testcase.boulder.ibm.com/as400/fromibm/ApiSamples/ifstool.savf
>
>It contains one interesting program called QRYIFSLIB.
>This can be called in a number of ways from CL or whatever
>and it produces a nice outfile with a lot of fields (size etc.).
Where are the tools documented? The savefile contains the C programs only.
--
Njål Fisketjøn, FIGU DATA AS
n...@figu.no / http://www.figu.no
Bengt
"Njål Fisketjøn" <n...@figu.no> skrev i meddelandet
news:rpn4hus4ivn2qch7v...@4ax.com...