doschdir
Purpose
Changes the current DOS Services directory or current
drive.
Library
DOS Services Library (libdos.a)
Syntax
#include <dos.h>
int doschdir (path)
char *path;
Description
The doschdir subroutine changes the current directory on
the current drive to the directory specified by the path
parameter, or changes the current drive to the drive
specified in the path parameter. If the path parameter
contains only a drive name, then only the current drive
is changed. If the path parameter contains only a direc-
tory path name, then only the current directory on the
current drive is changed. If the path parameter contains
both a drive name and a directory path name, then the
current drive and the current directory are both changed.
When the current drive is set to a drive that contains a
DOS file system, the AIX current directory cannot follow
along. Therefore, the current AIX directory is set to
the special directory /usr/dos/nulldir, if it exists.
Normally, the user does not have write access to the
/usr/dos/nulldir directory. Therefore, if a program
aborts, the core dumps are suppressed. If you do not
want this to happen, you must remove the /usr/dos/nulldir
directory.
Return Value
Upon successful completion, a value of 0 is returned. If
the doschdir subroutine fails, a value of -1 is returned
and doserrno is set to indicate the error.
Related Information
In this book: "DOS services library," "dospwd," and
"dosassign."