HPlogo MPE/iX Commands Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3  Command Definitions C-E

CHDIR

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Changes the process' current working directory (CWD). (Native Mode)

Syntax

CHDIR [ [DIR=]dir_name] [;SHOW | NOSHOW]

Parameters

dir_name

The name of the directory you want to change to, which is assumed to be an MPE name unless you specify otherwise. To change to an HFS-named directory, begin dir_name with a dot (.) or a slash (/). The dir_name may not end in a slash, and using wildcards is not allowed.

This parameter is optional. If you omit dir_name, CHDIR switches you to your logon directory, which is your logon group in the form /LOGON_ACCOUNT/LOGON_GROUP in all uppercase letters.

SHOW

Displays the absolute pathname of the new directory on $STDLIST. SHOW is the default.

NOSHOW

Does not display the absolute pathname.

Operation

The CHDIR command changes the process' current working directory to dir_name or to the logon group, if you omit dir_name. You can change the CWD to any HFS directory if you precede dir_name with a dot (.) or a slash (/) or to an MPE account or group to which you have the appropriate permission.

Issuing the CHDIR command does not give users access to files in a directory (or group and account) that they would not otherwise have. That is, it has no affect on file access permissions.

The CWD is a process-local attribute, which means that CHDIR changes the CI's CWD for the life of that CI process or until another CHDIR command is issued. When CHDIR is executed programmatically from a child process of the CI (e.g., HPEDIT), only that process' CWD is changed; the CWD of the parent process (in this example, the CI) remains the same.

CHDIR does not post any accounting information: Connect and CPU time are still accounted to the user's logon account and group.

HPCWD is a read-only, CI string variable that contains the name of the current working directory in HFS syntax. At logon, HPCWD contains /account_name/logon_group_name. The CHGROUP command causes the HPCWD variable to be set to /account/group_changed_to.

The table on the next page summarizes the differences and similarities between the CHDIR and CHGROUP commands.

AffectsCHGROUPCHDIR
Accumulation of CPU and Connect timesyesno
Set of accessible filesyesno
CWD of processyesyes
HPCWD variableyesyes
Disk space accumulationyesno

Use

The CHDIR command may be invoked from a job, a session, a program, or in Break. Pressing Break has no effect on this command. You must have traverse directory entries (TD) permission to each directory component in dir_name (refer to the ALTSEC command in this chapter for more information on directory permissions.) The CWD is not changed if the CHDIR command fails.

Examples

The following example shows the command entry to change to the directory dir1 in the MYGRP group in the MYACCT account.

 CHDIR /MYACCT/MYGRP/dir1

The following example shows the command entry to change to the MPE group level (AGROUP) in the MYACCT account.

 CHDIR /MYACCT/AGROUP

The following example shows the command entry to change to a directory named My_dir. In this example, My_dir is a relative pathname and it is subdirectory in the current working directory (CWD).

 CHDIR ./My_dir

The following example shows the command entry to change to a directory named john, in the group JONES, in the account MYACCT, by specifying the full pathname.

 CHDIR /MYACCT/JONES/john

In the following example, a change is made to a directory named final by specifying the relative pathname. The variable HPCWD displays the current working directory after the change is made.

 CHDIR ./es/final
SHOWVAR HPCWD

HPCWD = /MYACCT/JONES/john/es/final

Related Information

Commands

CHGROUP, FINDDIR (UDC), LISTFILE, LISTDIR (UDC), NEWDIR, PURGEDIR

Manuals

Performing System Management Tasks

Feedback to webmaster