E9.2 Linux Enterprise Server and Readdir API - see "read folder contents / filename from a folder"

ccornagg

Well Known Member
Dear JDElist,

did someone have experience with the 3 APIs jdeOpendir / readdir / jdeClosedir on Linux Enterprise Server ?

In standard JDE code you can find similar logic in two BSFN:

* B7400015 – Standard BSFN used to read European eInvoice XML response
* B76B525 – Standard BSFN doing something similar with Brazilian “Nota Fiscal” response

I'm currently running my own C BSFN which is similar to standard one, and which is succesfully running on iSeries and Linux Servers.

Issue is: readdir is going to fail when my Linux folder is a mounted share, thus it's not a directory stored into the same Linux enterprise server.

Please consider this is not affecting any other piece of code, for example: standard P007101 interactive program is able to read and to write *specific* files into a mounted share, but apparently there's no chance to read folder filename list.

Do you have any clue on whether there's a solution different from using a local Linux folder ?

Thanks,

Carlo

E1 9.2.5.x
 
Hi Carlo

Did you fix this? I am looking into a similar BSFN that works in 9.0 but not on our new 9.2 using 9.2.5

Here's the code, that works when called the 1st time (no pointer) but falls over when called a second time with the pointer from the first call
 

Attachments

  • B5500040.pdf
    946.8 KB · Views: 22
Hi John,

the only issue I had with readdir API was related to Linux "mapped folders", thus directories sitting into another machine.
It seems to me your issue is different: in my opinion you cannot call readdir several time with a pointer in order to mime something similar to standard B9600471 (client only) containing FindFirstFileMatchingWildcard and FindNextFileMatchingWildcard.

In my piece of code I'm using JDEcache to store filenames, but you can also use an array as you can see from standard code "B7400015 - Wrapper For XML Response Parser - 74 - EU" (mentioned in my previous message).

Kind regards,

Carlo
 
Dear JDElist,

did someone have experience with the 3 APIs jdeOpendir / readdir / jdeClosedir on Linux Enterprise Server ?

In standard JDE code you can find similar logic in two BSFN:

* B7400015 – Standard BSFN used to read European eInvoice XML response
* B76B525 – Standard BSFN doing something similar with Brazilian “Nota Fiscal” response

I'm currently running my own C BSFN which is similar to standard one, and which is succesfully running on iSeries and Linux Servers.

Issue is: readdir is going to fail when my Linux folder is a mounted share, thus it's not a directory stored into the same Linux enterprise server.

Please consider this is not affecting any other piece of code, for example: standard P007101 interactive program is able to read and to write *specific* files into a mounted share, but apparently there's no chance to read folder filename list.

Do you have any clue on whether there's a solution different from using a local Linux folder ?

Thanks,

Carlo

E1 9.2.5.x
Can you please help me with your code, I also have similar requirement to work in AS400 to pick multiple files.
 
Can you please help me with your code, I also have similar requirement to work in AS400 to pick multiple files.

Standard code is better then mine: I would suggest to take a look at already mentioned B7400015 "WrapperForXMLResponseParser_74" where you can see how to use C preprocessor statements ("#ifdef JDENV_PC" which means Windows and "#else" which means AS400 / Unix) in order to retrieve file names into a folder.

Internal function name is "IB7400015_GetDirList": it calls alternatively "IB7400015_GetWinDirList" or "IB7400015_GetUnixDirList" depending on platform type.

Kind regards,

Carlo
 
Hi John,

the only issue I had with readdir API was related to Linux "mapped folders", thus directories sitting into another machine.
It seems to me your issue is different: in my opinion you cannot call readdir several time with a pointer in order to mime something similar to standard B9600471 (client only) containing FindFirstFileMatchingWildcard and FindNextFileMatchingWildcard.

In my piece of code I'm using JDEcache to store filenames, but you can also use an array as you can see from standard code "B7400015 - Wrapper For XML Response Parser - 74 - EU" (mentioned in my previous message).

Kind regards,

Carlo
Hi Carlo,

Did you issued get resolved? We are facing the same issue with a custom BSFN to read multiple files, when the path is mounted share on the Unix server. If the path is given on the Enterprise server its working fine but not on some mounted directories. Please let me know if you are able to fix this issue. It has become bottle neck for us. :(
 
Hi Carlo,

Did you issued get resolved? We are facing the same issue with a custom BSFN to read multiple files, when the path is mounted share on the Unix server. If the path is given on the Enterprise server its working fine but not on some mounted directories. Please let me know if you are able to fix this issue. It has become bottle neck for us. :(
Hi Mainak,

unfortunately I did not manage to find any solution to have readdir API working on mounted share.
We simply moved that specific directory in the enterprise server machine.

Kind regards,

Carlo
 
Hi Mainak,

unfortunately I did not manage to find any solution to have readdir API working on mounted share.
We simply moved that specific directory in the enterprise server machine.

Kind regards,

Carlo
Thanks Carlo for you advice. We will try the same and see if it works.
 
Back
Top