home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / section5 / fxn41h.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  1.2 KB  |  24 lines

  1.         ;************************************************************;
  2.         ;                                                            ;
  3.         ;                Function 41H: Delete File                   ;
  4.         ;                                                            ;
  5.         ;                int delete(pfilepath)                       ;
  6.         ;                    char *pfilepath;                        ;
  7.         ;                                                            ;
  8.         ;                Returns 0 if file deleted,                  ;
  9.         ;                otherwise returns error code.               ;
  10.         ;                                                            ;
  11.         ;************************************************************;
  12.  
  13. cProc   delete,PUBLIC,ds
  14. parmDP  pfilepath
  15. cBegin
  16.         loadDP  ds,dx,pfilepath ; Get pointer to pathname.
  17.         mov     ah,41h          ; Set function code.
  18.         int     21h             ; Ask MS-DOS to delete file.
  19.         jb       dl_err         ; Branch if MS-DOS could not delete
  20.                                 ; file.
  21.         xor     ax,ax           ; Else return 0.
  22. dl_err:
  23. cEnd
  24.