This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS
Note: This is legacy API call. It is recommended to use 32-bit equivalent
This call defines the current directory for the requesting process.
DosChDir (DirName, Reserved)
rc (USHORT) - return
Return code descriptions are:
The directory path is not changed if any member of the path does not exist. The current directory changes only for the requesting process.
For FSDs, the case of the current directory is set according to the DirName passed in, not according to the case of the directories on disk. For example, if the directory “c:\bin” is created and DosChDir is called with DirName “c:\bin”, the current directory returned by DosQCurDir will be “c:\bin”.
Programs running without the NEWFILES bit set are allowed to DosChDir to a non-8.3 filename format directory.
DosQSysInfo must be used by an application to determine the maximum path length supported by OS/2. The returned value should be used to dynamically allocate buffers that are to be used to store paths.
#define INCL_DOSFILEMGR USHORT rc = DosChDir(DirName, Reserved); PSZ DirName; /* Directory path name */ ULONG 0; /* Reserved (must be zero) */ USHORT rc; /* return code */
This example changes directories to \os2\system.
#define INCL_DOSFILEMGR #define PATH "\\os2\\system" #define RESERVED 0L USHORT rc; rc = DosChDir(PATH, RESERVED);
EXTRN DosChDir:FAR INCL_DOSFILEMGR EQU 1 PUSH@ ASCIIZ DirName ;Directory path name string PUSH DWORD 0 ;Reserved (must be zero) CALL DosChDir
Returns WORD
Text based on http://www.edm2.com/index.php/DosChDir