Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:docs:fapi:doschdir [2018/09/02 03:51] – prokushev | en:docs:fapi:doschdir [2021/09/17 03:42] (current) – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{logos:os2.gif? | + | {{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 |
- | | + | <code c> |
+ | DosChDir (DirName, Reserved) | ||
+ | </ | ||
- | ==Parameters== | + | ===== Parameters |
- | *DirName (PSZ) - input : Address of the ASCIIZ directory path name. | ||
- | *Reserved (ULONG) - input : Reserved and must be set to zero. | ||
- | ==Return Code== | + | *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 descriptions are: | Return code descriptions are: | ||
Line 28: | Line 32: | ||
* 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 " | + | 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 " |
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=== | + | |
- | | + | ==== C Binding ==== |
- | + | ||
- | USHORT | + | <code c> |
- | + | #define INCL_DOSFILEMGR | |
- | PSZ DirName; | + | |
- | ULONG 0; /* Reserved (must be zero) */ | + | USHORT |
- | + | ||
- | USHORT | + | PSZ DirName; |
+ | ULONG 0; /* Reserved (must be zero) */ | ||
+ | USHORT | ||
+ | </ | ||
This example changes directories to \os2\system. | This example changes directories to \os2\system. | ||
+ | <code c> | ||
+ | #define INCL_DOSFILEMGR | ||
- | #define INCL_DOSFILEMGR | + | #define PATH " |
- | + | #define RESERVED 0L | |
- | | + | |
- | #define RESERVED 0L | + | |
- | + | ||
- | USHORT rc; | + | |
- | + | ||
- | rc = DosChDir(PATH, | + | |
- | ===MASM Binding=== | + | USHORT rc; |
- | | + | rc = DosChDir(PATH, |
- | INCL_DOSFILEMGR | + | |
+ | </ | ||
+ | |||
+ | ==== MASM Binding ==== | ||
+ | |||
+ | |||
+ | <code asm> | ||
+ | EXTRN DosChDir: | ||
+ | INCL_DOSFILEMGR | ||
| | ||
- | | + | PUSH@ ASCIIZ |
- | PUSH | + | PUSH |
- | CALL | + | CALL |
+ | </ | ||
Returns WORD | Returns WORD | ||
- | === Note === | + | ===== Note ===== |
Text based on http:// | Text based on http:// |