There seem to be two pieces: (1) How do you retrieve the size of a
stream file? (2) How do you monitor this?

The answer to (2) is pretty much the same as how you would monitor
anything else on the i. Maybe set up a recurring job that performs (1)
and then gives you a report or alerts you if a threshold is reached,
etc.

So how to do (1)? Well, one fairly simple way is to get the output of
a Unix-style directory listing using Qshell. You can direct that
output to a physical file, if you find it easier to work with it
there. For example,

qsh cmd('ls -l /my/ifs/file > /qsys.lib/mylib.lib/myfile.file/mymbr.mbr')

Then, in MYMBR you will have something of the form

-rwxrwxrwx 1 OWNER 0 4323 Dec 3 2014 /my/ifs/file

You can substring that to pull out the size (in this case, 4323 bytes).

It's not as robust as using APIs to work with IFS files "directly",
but if you don't already have the wrappers and scaffolding set up to
handle the APIs, this is a very straightforward and quick way to get
what you need.

John Y.

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.