Integrated File System Introduction

 

Current directory and home directory

Your current directory is the first directory in which the operating system looks for your programs and files and stores your temporary files and output. When you request an operation on an object, such as a file, the system searches for the object in your current directory unless you specify a different directory path. The current directory is similar to the idea of the current library. It is also called the current working directory, or just working directory.

The home directory is used as the current directory when you sign on the system. The name of the home directory is specified in your user profile. When your job is started, the system looks in your user profile for the name of your home directory. If a directory by that name does not exist on the system, the home directory is changed to the "root" (/) directory.

Typically, the system administrator who creates the user profile for a user would also create the user's home directory. Creating individual home directories for each user under the /home directory is recommended. The /home directory is a sub-directory under the "root" (/) directory. The system default expects the name of the home directory of a user to be the same name as the user profile.

For example, the command CRTUSRPRF USRPRF(John) HOMEDIR(*USRPRF) will assign the home directory for John to /home/JOHN. If the directory /home/JOHN does not exist, the root (/) directory becomes the home directory for John.

You can specify a directory other than the home directory as your current directory at any time after you sign on by using the Change Current Directory (CHGCURDIR) CL command, the chdir( ) API, or the fchdir() API.

The home directory chosen during process initiation will remain each thread's home directory by default. This is regardless of whether your active user profile for the thread has changed after initiation. However, there is support provided by the Change Job (QWTCHGJB) API that can be used to change the home directory being used for a thread to that thread's current user profile's home directory (or the "root" (/) directory if that home directory does not exist). Secondary threads will always inherit the home directory of the thread that created it. Note that the process' current directory does not change when you use QWTCHGJB to change the thread's home directory. The current directory is scoped to the process level, and the home directory is scoped to the thread level. Changing the current working directory in any thread changes it for the whole process. Changing the home directory for a thread does not change its current working directory.

See the Application programming interfaces (APIs) topic for details on the QWTCHGJB API.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]