PDA

View Full Version : "List IFS Objects" Api?



buck.calabro@commsoft.net
06-17-2004, 05:09 AM
> I want to list all the objects in a specific directory, > but can't find anything in the IBM API finder? There are several approaches, depending on your preferences. opendir(), readdir() and closedir() are one way; Qp0lProcessSubtree is another. I wrapped the ...dir() APIs in an RPG program which I can call from CL in a loop to get all of the files. stat() helps you find the files (as opposed to the symbolic links and directories.) --buck

gary.shipp@s3t.co.uk
06-18-2004, 12:26 AM
I've done something based around readdir() etc, seems easy enough. Thanks a lot.

gary.shipp@s3t.co.uk
06-18-2004, 02:11 AM
Just another couple of things on this. The QUSLOBJ API allows provides, among other things, the create date and time of each object. How would I achieve this with the readdir etc approach? I notice the lstat data structure includes a field called st_cdate. Would this be a date/time stamp recording object creation by any chance? If so, can I then just use the QWCCVTDT to convert this? Also, what command would I use to emulate DSPPFM over an IFS object? Thanks again

buck.calabro@commsoft.net
06-18-2004, 05:25 AM
> The QUSLOBJ API allows provides, among other > things, the create date and time of each object. > > How would I achieve this with the readdir etc > approach? The times returned by the stat() functions are in seconds since 1 Jan 1970 (time_t). They can be mapped into individual fields (struct tm) by gmtime(time_t) or localtime(time_t). You can map directly to a text string with ctime(time_t) or asctime(tm) This link might explain it better thanI can http://larc.ee.nthu.edu.tw/~mjhsiao/CPL/ch8.htm > Also, what command would I use to > emulate DSPPFM over an IFS object? Maybe edtf? --buck

gary.shipp@s3t.co.uk
06-18-2004, 05:38 AM
Thanks Buck re the edtf, the only concern I have with that is it may allow a user to edit a file, which I don't want them to do, I just want them to display its contents. Gary

buck.calabro@commsoft.net
06-18-2004, 06:34 AM
Hi Gary! > re the edtf, the only concern I have with that is > it may allow a user to edit a file, which I don't > want them to do, I just want them to display its > contents. Sorry, I didn't realise this was for end users. On my V5R2 system I have dspf. --buck

gary.shipp@s3t.co.uk
06-18-2004, 07:29 AM
Does an IFS equivalent of the QUSLOBJ exist? I want to list all the objects in a specific directory, but can't find anything in the IBM API finder? If not, what should I do? TIA

gary.shipp@s3t.co.uk
06-18-2004, 07:29 AM
Thats alright, Buck, I didn't say it was! Dspf is good, I'll use that thanks.