× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Carsten,

I can't get my little program to work:

H DFTACTGRP(*NO) ACTGRP(*NEW)

/copy ifsio_h

d Qp0lGetPathFromFileID...
d pr * ExtProc('Qp0lGetPathFromFileID')
d bufPointer * value
d size 10u 0 value
d fileid 16a


d Qp0lFID_j ds qualified
d 8a inz(*allx'00')
d gid 10u 0
d fid 10u 0

d MyStat s like(statds64)
d i s 10i 0
d ifsPath s 100a varying
d pathFromApi s 1000a based(p_pathFromApi)

/free

*inlr = *on;

ifsPath = '/jgvtmp/is511551.JPG';
i = stat64(ifsPath : %addr(MyStat));

p_statds64 = %addr(MyStat);

Qp0lFID_j.gid = statds64.st_ino_gen_id;
Qp0lFID_j.fid = statds64.st_ino;
p_pathFromApi = Qp0lGetPathFromFileID (p_pathFromApi: %size(pathFromApi)
: Qp0lFID_j);

return;

/end-free


The pointer p_pathFromApi that is returned, is *NULL. I've checked fid and gid with Qp0lGetAttr. They are identical. What am I doing wrong?

Thank you very much in advance.

Best regards

Jan



Am 22.12.2015 um 12:07 schrieb Flensburg, Carsten:
Jan,

Here you go:

**-- Get path name from File ID:
D GetPathFrom...
D FileID Pr * ExtProc( 'Qp0lGetPathFromFileID' )
D pBuf * Value
D BufSiz 10u 0 Value
D FileID 16a

Best regards,
Carsten

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jan Grove Vejlstrup
Sent: 22. december 2015 11:23
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Exact Name of File in Root-Part of IFS

Carsten,

Thank you for your answer. Could you post me the procedure GetPathFromFileID? Thank you.

Best regards

Jan

Am 21.12.2015 um 15:38 schrieb Flensburg, Carsten:
Joop,

Using st_ino in conjunction with st_ino_gen_id as in the example below should do the trick:

**-- File ID structure:
D Qp0lFID_t Ds Qualified
D 8a Inz( *Allx'00' )
D Gid 10u 0
D Fid 10u 0
/Free
Qp0lFID_t.Fid = Buf.st_ino;
Qp0lFID_t.Gid = Buf.st_ino_gen_id;

pBufPth = GetPathFromFileID( pBufPth: %Size( BufPth ): Qp0lFID_t
);

Cheers,
Carsten

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
j.beckeringh@xxxxxxxxxxxxxxxxxxxxxxxxxx
Sent: 21. december 2015 15:31
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Exact Name of File in Root-Part of IFS

Stu,

That does indeed return the correctly spelled path, but not with the file id (st_ino) that stat (or stat64) returns. You have to use Qp0lGetAttr with QP0L_ATTR_FILE_ID to get the file id.

This communication is intended only for use by the addressee.It may contain confidential or privilegedinformation.
If you receive this communication unintentionally, please inform us immediately and delete this e-mail and any attachments.
Warning: Although we have taken reasonable precautions to ensure no
viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the use of this email or attachments.
--
This is the RPG programming on the IBM i (AS/400 and 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.

This communication is intended only for use by the addressee.It may contain confidential or privilegedinformation.
If you receive this communication unintentionally, please inform us immediately and delete this e-mail and any attachments.
Warning: Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept
responsibility for any loss or damage arising from the use of this email or attachments.


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.