× 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.



IBM pointed out my problem with using readdir() in directory QDLS as using
a "clear" opcode with QDLS.
The bad line of code is the "clear" opcode just before the readdir() call:

     C                   Clear                   dirent
     C                   Eval      p_dirent = readdir(dh)

The 'dirent' field is based off p_dirent. That storage is given back to
the application by the previous readdir(). It is NOT to be changed by
the application. That storage, in essence, is owned by readdir(), not
the application. The application can read it, of course, but should
never change it. The "Clear" statement above must be removed.

On one readdir() QDLS actually retrieves many directory entries and
squeezes them into that space. It also stores information necessary to
retrieve the next directory entry there. Other file systems, like the
root, don't do that and so clearing the space doesn't hurt. Again,
though, the application should never change the contents of what it
gets back from readdir().

** Craig wrote:
Scott mentioned using / instead of \.  That was just a typo in my e-mail.
I am already using / unsuccessfully.  I am also enrolled in the system
distribution directory (WRKDIRE).  I have all authority to QDLS and most
folders in QDLS.  Doing WRKLNK '/QDLS' shows PUBLIC *RWX for data and no
authority for object.  I can see most of the folders in QDLS using WRKLNK.

** Craig wrote:
I have been listing directories and files in the IFS for quite some time
now.  I recently discovered I was not listing anything in the \QDLS
directory.  I am using RPG IV with the opendir() and readdir() in a
recursive subprocedure.  This appears to get all directories and files
except those in the \QDLS directory.  On debug, I see that \QDLS is
successfully opened and only one directory (".") is read.  There are many
directories (folders) with files but they do not show up on any of the
readdir()s.  Any ideas?

Craig Strong


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.