home *** CD-ROM | disk | FTP | other *** search
- ;******************************************************************************
- ; Filename: UNLINK.ASM
- ; Author: Peter Andersson
- ; Version: 0.0
- ; Created: 1994.06.05
- ; Updated: 1994.09.20
- ;******************************************************************************
- ; Copyright Peter Andersson, 1994-1995.
- ; All rights reserved.
- ;******************************************************************************
- ; Function: LONG @unlink(PSZ filename)
- ; Comment: Deletes a file
- ; Input: Eax, filename - pointer to filename
- ; Returns: -1 if an error occured or 0 if everything is alright
- ;******************************************************************************
-
- Include STDDEF.INC
-
- Codeseg
-
- Proc unlink ,1
- Mov Edx,Eax
- Mov Ah,41h
- Int 21h
- Jc @@Error
- Clear Eax
- Ret
- Align 4
- @@Error: Mov [Word errno],Ax
- IfDef DEBUG
- Call printf,Offset ErrDeleteMsg,Edx,Ax
- Endif
- Mov Eax,-1
- Ret
- Endp
-
- Dataseg
-
- IfDef DEBUG
- ErrDeleteMsg Db "Error deleting file '%s'! Error: %h",LF,0
- Endif
-
- End