AS/400 Integrated File System problem

425 pts.
Tags:
AS/400
as/400 files
Integrated File System
when I used the path as '/demo/file1' to open the stream file using API QHFOPNSF I'm getting the error "File system name demo not found." Aren't the file system and directory are same?

Answer Wiki

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

<i>…using API QHFOPNSF…</i>

You can only use QHFOPNSF in a hierarchical file system (HFS). The two standard HFSs on the system are /QDLS and /QOPT. You could create your own HFS and mount it as “demo”, but I suspect that that’s <i>not</i> what you’re trying to do.

<i>Aren’t the file system and directory are same?</i>

No. They are very different.

A path can indicate <b>at least</b> five different things:
<ol>
<li>Absolute or relative addressing</li><li>File system</li><li>Directory (and subdirectories)</li><li>Redirection</li><li>The object</li>
</ol>

A path that begins with a slash (“/”) character is an absolute path. That path is the actual path to the object (as long as symbolic links or redirection doesn’t point somewhere else). If a path does not start with a slash, it’s a relative path. The path is ‘relative’ to whatever the ‘current directory’ is for the job.

The first node of an absolute path indicates the file system. There are two kinds of file systems as far as this point is concerned — the /root file system and all other file systems. A file system must be registered with the system. If the node doesn’t match the name of a registered file system, then it’s in the /root file system. (“/demo” is almost certainly not registered, so it’s merely a directory within the /root file system.) Example file systems are /QNTC, /QSYS.LIB, /QOPT and /root. A file system determines things like the valid methods for accessing objects within it.

Redirection happens when a node is either “/.” or “/..” instead of a name. When “/.” is found as a node in a path, it indicates that the rest of the path is relative to the current position in the path. (If the path simply begins with “.”, then the current position is the job’s current directory.) When “/..” is in the path, then the path is redirected to the previous node. E.g., “/home/MyDir/..” is equivalent to “/home”.

And the final node is whatever streamfile or other object is at that point in the path.

<i>when I used the path as ‘/demo/file1′ to open the stream file using API QHFOPNSF I’m getting the error
“File system name demo not found.”</i>

If someone else created “demo” as a user-defined file system (UDFS) and you’re trying to use it, then you’ll need to mount it over an existing directory first. Use the MOUNT command with the TYPE(*UDFS) parameter. Assuming that “demo” really is a valid UDFS, then you might be able to use QHFOPNSF.

Otherwise, you need to use the normal IFS APIs to process your streamfile.

Tom

Discuss This Question: 2  Replies

 
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
  • Kar
    Tom, If I'm using MOUNT command, then I have given Type of File System as *UDFS File System to mount . . . . '/demo' Directory to mount over . . . ??????? Mount Options. . . . ???? Can you please expalin what values can be given to make DEMO as registered with the system and then to access using QHFOPNSF
    425 pointsBadges:
    report
  • TomLiotta
    ...to make DEMO as registered with the system and then to access using QHFOPNSF If you want to use /demo with the HFS APIs, you have two general choices -- you start by creating it under /QDLS as a folder that contains *FLR and *DOC kinds of objects or create it as a user-written file system in such a way as to be compatible with the HFS APIs. If it already exists in the /root file system, then the HFS APIs are not appropriate. If you choose to go forward with a user-written file system, you have a lot of work ahead of you. Start with reading about the File System Registration APIs to get a feeling for the scope of the project ahead of you. But if you are very lucky, the content of your current /demo directory can be copied into the /QDLS file system. You won't have to create a file system; you might use the basic HFS that already exists. You'll have to follow the /QDLS rules, but that's easier than what's necessary to create your own. If neither of those work for you, then you're back to using open(), close(), read(), write() and whatever other IFS APIs are appropriate. Tom
    125,585 pointsBadges:
    report

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