Great, so I write to scott asking if he knew of a way to retrieve the object
creation date for an IFS file and he says "Use Qp0lGetAttr but it's a $#@$&
of an API" and then goes and writes an article about it.  <vbg>

Well I just paid the $29 bucks to read that article at it is a bit
misleading if you don't know the background of these kinds of APIS.

Note that Scott (who is a great mind and probable has forgotten more more
about the IFS that you or I will ever know) uses the following /COPY
statement:

/copy QP0LSTDI_H

I don't know where that /COPY located as it is not listed in the article,
but then later he calls the qp0lGetAttr API as follows:

if (Qp0lGetAttr( MyPath 
                : AttrList
                : buf
                : BufSize
                : SizeNeeded
                : SizeReturned
                : QP0L_FOLLOW_SYMLNK ) < 0);
The Attribute list is defined as follows:
     D AttrList        ds                  likeds(Qp0l_AttrTypes_List_t)


But where is MYPATH parameter defined? I don't see that in the article
either. MYPath is NOT a simple '/home/cozzi/myifsfile.txt' thing. It is a
data structure. That data structure is defined as follows:
     D Qlg_Path_Name_T...
     D                 DS                  Align 
     D   lg_ccsid                    10I 0 Inz(37) 
     D   lg_Region                    2A   Inz(*ALLX'00')
     D   lg_LangID                    3A   Inz(*ALLX'00')
     D   lg_Reserved1                 3A   Inz(*ALLX'00')
     D   lg_PathType                 10I 0 Inz(0)
     D   lg_nPathLen                 10I 0 Inz(0)
     D   lg_PathDelim                 2A   Inz('/')
     D   lg_Reserved2                10A   Inz(*ALLX'00')
     D   lg_PathName                640A   Inz(*ALLX'00')

You need to copy your file path into the lg_PathName subfield and then set
the length of lg_nPathLen to the length of that file name, as follows:
     C                   eval      lg_nPathLen = %len(%trimR(MyPath))
     C                   eval      lg_PathName = %trimR(MyPath)
I've set up the rest of the subfields for you so that should work on most
North American AS/400 installs. If not, then you need to grab the CCSID,
language ID and Country Codes.
Or as I always like so say, Use the RPG xTools procedure ifsGetCrtDate() to
easily retrieve the information you need into a nice little data structure.
All you'd have to do is the following:
       D ifsCrtDate      S               D

  eval  ifsCrtDate = ifsGetCrtDate('/home/cozzi/myfile.txt');

Or to get all the object-dates for an IFS file...
     D  ifsDates       DS                  LikeDS(IFS_fDates)
   ifsGetCrtDate('/home/cozzi/myfile.txt': ifsDates);  

-Bob Cozzi


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Christian Wildt
Sent: Wednesday, December 01, 2004 4:57 AM
To: RPG programming on the AS400 / iSeries
Subject: GetIfsAttr - No such path or directory

Hi there

I´ve been looking for a tool box to retrive info about  *STMF, and was 
happy to find Scotts GetIfsAttr util. - just great
http://www.iseriesnetwork.com/artarchive/index.cfm?fuseaction=viewarticle&CO
_ContentID=19557&channel=art&subart=top&topicid=25

BUT I can´t  get passed the first call to Qp0lGetAttr - it just says 
CPE3025 - No such path or directory. 

I have *allobj and tried almost every combination with and without / 

The file is a *Stmf and works fine with WRKLNK and DSPF (no problems)

any suggestion on what to do 

Best regards
Christian Wildt
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





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.