en:docs:fapi:doschdir

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:doschdir [2018/08/26 13:28] – created prokusheven:docs:fapi:doschdir [2021/09/17 03:42] (current) prokushev
Line 1: Line 1:
-{{logos:os2.gif?35x35}} {{logos:dos.gif?35x35}}+{{page>en:templates:fapiint}}
 ====== DosChDir ====== ====== DosChDir ======
  
 This call defines the current directory for the requesting process. This call defines the current directory for the requesting process.
  
-==Syntax== +===== Syntax =====
- DosChDir (DirName, Reserved)+
  
-==Parameters== +<code c> 
-;DirName (PSZ) - input : Address of the ASCIIZ directory path name. +DosChDir (DirName, Reserved) 
-;Reserved (ULONG) - input : Reserved and must be set to zero.+</code> 
 + 
 +===== Parameters ===== 
 + 
 + 
 +  *DirName ([[PSZ]]) - input : Address of the ASCIIZ directory path name. 
 +  *Reserved ([[ULONG]]) - input : Reserved and must be set to zero. 
 + 
 +===== Return Code ===== 
 + 
 + 
 +rc ([[USHORT]]) - return
  
-==Return Code== 
- rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-* 0  NO_ERROR +  * 0  NO_ERROR 
-* 2  ERROR_FILE_NOT_FOUND  +  * 2  ERROR_FILE_NOT_FOUND  
-* 3  ERROR_PATH_NOT_FOUND +  * 3  ERROR_PATH_NOT_FOUND 
-* 5  ERROR_ACCESS_DENIED +  * 5  ERROR_ACCESS_DENIED 
-* 8  ERROR_NOT_ENOUGH_MEMORY  +  * 8  ERROR_NOT_ENOUGH_MEMORY  
-* 26  ERROR_NOT_DOS_DISK +  * 26  ERROR_NOT_DOS_DISK 
-* 87  ERROR_INVALID_PARAMETER +  * 87  ERROR_INVALID_PARAMETER 
-* 108  ERROR_DRIVE_LOCKED +  * 108  ERROR_DRIVE_LOCKED 
-* 206  ERROR_FILENAME_EXCED_RANGE+  * 206  ERROR_FILENAME_EXCED_RANGE 
 + 
 +===== Remarks ===== 
  
-==Remarks== 
 The directory path is not changed if any member of the path does not exist. The current directory changes only for the requesting process. 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".+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. 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. +[[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. 
  
-==Example Code== +===== Example Code ===== 
-===C Binding=== + 
-<PRE>+==== C Binding ===
 + 
 +<code c>
 #define INCL_DOSFILEMGR #define INCL_DOSFILEMGR
  
 USHORT  rc = DosChDir(DirName, Reserved); USHORT  rc = DosChDir(DirName, Reserved);
  
-PSZ              DirName;       /* Directory path name *+PSZ              DirName;       /* Directory path name */
 ULONG            0;             /* Reserved (must be zero) */ ULONG            0;             /* Reserved (must be zero) */
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE> +</code>
 This example changes directories to \os2\system.  This example changes directories to \os2\system. 
-<PRE>+<code c>
 #define INCL_DOSFILEMGR #define INCL_DOSFILEMGR
  
Line 55: Line 66:
 USHORT rc; USHORT rc;
  
-   rc = DosChDir(PATH, RESERVED); +rc = DosChDir(PATH, RESERVED); 
-</PRE+ 
-===MASM Binding=== +</code> 
-<PRE>+ 
 +==== MASM Binding ===
 + 
 + 
 +<code asm>
 EXTRN  DosChDir:FAR EXTRN  DosChDir:FAR
 INCL_DOSFILEMGR     EQU 1 INCL_DOSFILEMGR     EQU 1
 +  
 PUSH@  ASCIIZ  DirName       ;Directory path name string PUSH@  ASCIIZ  DirName       ;Directory path name string
 PUSH   DWORD               ;Reserved (must be zero) PUSH   DWORD               ;Reserved (must be zero)
 CALL   DosChDir CALL   DosChDir
 +</code>
  
 Returns WORD Returns WORD
-</PRE> 
  
-=== Note ===+===== Note ===== 
  
 Text based on http://www.edm2.com/index.php/DosChDir Text based on http://www.edm2.com/index.php/DosChDir