en:docs:fapi:dosdelete

Differences

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

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dosdelete [2018/08/26 14:34] – created prokusheven:docs:fapi:dosdelete [2021/12/05 09:53] (current) prokushev
Line 1: Line 1:
-{{logos:os2.gif?35x35}} {{logos:dos.gif?35x35}}+{{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 =====
- DosDelete (FileName, Reserved)+
  
-==Parameters== +<code c> 
-;FileName (PSZ- input : Address of the name of the file to be deleted. +DosDelete (FileName, Reserved
-:DosQSysInfo is called by an application during initialization to determine the maximum path length allowed by OS/2. +</code>
-; Reserved (ULONG) - input : Reserved and must be set to zero.+
  
-==Return Code== +===== Parameters =====
- rc (USHORT) - return +
-Return code descriptions are: +
-* 0         NO_ERROR  +
-* 2         ERROR_FILE_NOT_FOUND  +
-* 3         ERROR_PATH_NOT_FOUND  +
-* 5         ERROR_ACCESS_DENIED  +
-* 26        ERROR_NOT_DOS_DISK  +
-* 32        ERROR_SHARING_VIOLATION  +
-* 36        ERROR_SHARING_BUFFER_EXCEEDED  +
-* 87        ERROR_INVALID_PARAMETER  +
-* 206       ERROR_FILENAME_EXCED_RANGE+
  
-==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  rc = DosDelete(FileName, Reserved);+  rc (USHORT- return
  
-PSZ              FileName;      /* File name path */ +Return code descriptions are:
-ULONG            0;             /* Reserved (must be zero) */+
  
-USHORT           rc;            /return code */ +  0         NO_ERROR  
-</PRE> +  2         ERROR_FILE_NOT_FOUND  
-This example deletes a file in the current directory named test.dat. +  * 3         ERROR_PATH_NOT_FOUND  
 +  * 5         ERROR_ACCESS_DENIED  
 +  * 26        ERROR_NOT_DOS_DISK  
 +  * 32        ERROR_SHARING_VIOLATION  
 +  * 36        ERROR_SHARING_BUFFER_EXCEEDED  
 +  * 87        ERROR_INVALID_PARAMETER  
 +  * 206       ERROR_FILENAME_EXCED_RANGE
  
-<PRE> +===== 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  rc = DosDelete(FileName, Reserved);
 +  
 +  PSZ              FileName;      /* File name path */
 +  ULONG            0;             /* Reserved (must be zero) */
 +  
 +  USHORT           rc;            /* return code */
 +</code>
 +
 +==== Example ====
 +
 +This example deletes a file in the current directory named test.dat. 
 +<code c>
 +  #define INCL_DOSFILEMGR
 +  
 +  #define FILE_DELETE "test.dat"
 +  #define RESERVED 0L
 +  
 +  USHORT rc;
 +  
    rc = DosDelete(FILE_DELETE,    /* File path name */    rc = DosDelete(FILE_DELETE,    /* File path name */
                   RESERVED);      /* Reserved (must be zero) */                   RESERVED);      /* Reserved (must be zero) */
-</PRE> +</code>
-===MASM Binding=== +
-<PRE> +
-EXTRN  DosDelete:FAR +
-INCL_DOSFILEMGR     EQU 1+
  
-PUSH@  ASCIIZ  FileName      ;Filename path name string +==== MASM Binding ====
-PUSH   DWORD               ;Reserved (must be zero) +
-CALL   DosDelete+
  
 +<code asm>
 +  EXTRN  DosDelete:FAR
 +  INCL_DOSFILEMGR     EQU 1
 +  
 +  PUSH@  ASCIIZ  FileName      ;Filename path name string
 +  PUSH   DWORD               ;Reserved (must be zero)
 +  CALL   DosDelete
 +</code>
 Returns WORD Returns WORD
-</PRE> 
  
-====== Note ======+===== Note ===== 
  
 Text based on [[http://www.edm2.com/index.php/DosDelete_(FAPI)]] Text based on [[http://www.edm2.com/index.php/DosDelete_(FAPI)]]