Identifying objects mounted on a Windows drive on System i

Tags:
AS/400
AS/400 objects
DSPOBJD
Windows partition
How can I identify the objects that are in a mounted Windows drive from the IBM i? I want to do the equivalent of a dspobjd and send the object names to a file that I can then process.



Software/Hardware used:
iSeries, Windows

Answer Wiki

Thanks. We'll let you know when a new response is added.

The best method might be to open the directory with the opendir() API, read the entries with readdir() until the end, then close it with closedir(). At least one reason would be to process subdirectories recursively. Another reason is simply from the question — why put the entries into a file just to read them back when you can read them directly?

If the source directory is known only to contain streamfiles, and subdirectories won’t be a concern, then QShell provides an easy alternative. Use the ls utility to list each entry. The output can be redirected to a streamfile for example. Of course, then you’d need to read the streamfile. Or you could redirect to a flat file — be sure your file is created to hold the names you’ll run across.

In simple situations, I pipe the ls output into the dataq utility. Each entry becomes a data queue entry that can be received by a fairly simple program.

Choose appropriate options on the ls and dataq utilities to help format the entries with most of the info that you might need.

Tom

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following