Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:docs:fapi:dosdelete [2018/08/26 14:34] – created prokushev | en:docs:fapi:dosdelete [2021/12/05 09:53] (current) – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{logos:os2.gif? | + | {{page>en:templates:fapiint}} |
====== DosDelete ====== | ====== DosDelete ====== | ||
This call removes a directory entry associated with a file name. | This call removes a directory entry associated with a file name. | ||
- | ==Syntax== | + | ===== Syntax ===== |
- | | + | |
- | ==Parameters== | + | <code c> |
- | ;FileName | + | DosDelete (FileName, Reserved) |
- | : | + | </code> |
- | ; Reserved (ULONG) - input : Reserved and must be set to zero. | + | |
- | ==Return Code== | + | ===== Parameters ===== |
- | rc (USHORT) - return | + | |
- | Return code descriptions are: | + | |
- | * 0 | + | |
- | * 2 | + | |
- | * 3 | + | |
- | * 5 | + | |
- | * 26 ERROR_NOT_DOS_DISK | + | |
- | * 32 ERROR_SHARING_VIOLATION | + | |
- | * 36 ERROR_SHARING_BUFFER_EXCEEDED | + | |
- | * 87 ERROR_INVALID_PARAMETER | + | |
- | * 206 | + | |
- | ==Remarks== | + | *FileName ([[PSZ]]) - input : Address of the name of the file to be deleted. [[DosQSysInfo]] is called by an application during initialization to determine the maximum path length allowed by OS/2. |
- | Global file name characters are not permitted. | + | * Reserved ([[ULONG]]) - input : Reserved and must be set to zero. |
- | A file whose read-only attribute is set cannot be deleted. To change the setting of the read-only bit, call DosSetFileMode. | + | ===== Return Code ===== |
- | ==Example Code== | ||
- | ===C Binding=== | ||
- | <PRE> | ||
- | #define INCL_DOSFILEMGR | ||
- | USHORT | + | |
- | PSZ FileName; | + | Return code descriptions are: |
- | ULONG 0; /* Reserved (must be zero) */ | + | |
- | USHORT | + | |
- | </ | + | |
- | This example deletes a file in the current directory named test.dat. | + | * 3 |
+ | * 5 | ||
+ | * 26 ERROR_NOT_DOS_DISK | ||
+ | * 32 ERROR_SHARING_VIOLATION | ||
+ | * 36 ERROR_SHARING_BUFFER_EXCEEDED | ||
+ | * 87 ERROR_INVALID_PARAMETER | ||
+ | * 206 | ||
- | < | + | ===== Remarks ===== |
- | #define INCL_DOSFILEMGR | + | |
- | #define FILE_DELETE "test.dat" | + | Global file name characters are not permitted. |
- | #define RESERVED 0L | + | |
- | USHORT rc; | + | A file whose read-only attribute is set cannot be deleted. To change the setting of the read-only bit, call [[DosSetFileMode]]. |
+ | ===== Bindings ===== | ||
+ | |||
+ | ==== C Binding ==== | ||
+ | |||
+ | <code c> | ||
+ | #define INCL_DOSFILEMGR | ||
+ | | ||
+ | USHORT | ||
+ | | ||
+ | PSZ FileName; | ||
+ | ULONG 0; /* Reserved (must be zero) */ | ||
+ | | ||
+ | USHORT | ||
+ | </ | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | This example deletes a file in the current directory named test.dat. | ||
+ | <code c> | ||
+ | #define INCL_DOSFILEMGR | ||
+ | | ||
+ | #define FILE_DELETE " | ||
+ | #define RESERVED 0L | ||
+ | | ||
+ | USHORT rc; | ||
+ | | ||
rc = DosDelete(FILE_DELETE, | rc = DosDelete(FILE_DELETE, | ||
RESERVED); | RESERVED); | ||
- | </PRE> | + | </code> |
- | ===MASM Binding=== | + | |
- | < | + | |
- | EXTRN DosDelete: | + | |
- | INCL_DOSFILEMGR | + | |
- | PUSH@ ASCIIZ | + | ==== MASM Binding ==== |
- | PUSH | + | |
- | CALL | + | |
+ | <code asm> | ||
+ | EXTRN DosDelete: | ||
+ | INCL_DOSFILEMGR | ||
+ | | ||
+ | PUSH@ ASCIIZ | ||
+ | PUSH | ||
+ | CALL | ||
+ | </ | ||
Returns WORD | Returns WORD | ||
- | </ | ||
- | ====== Note ====== | + | ===== Note ===== |
Text based on [[http:// | Text based on [[http:// |