Category : C++ Source Code
Archive   : VCCRT1.ZIP
Filename : UNLINK.ASM

 
Output of file : UNLINK.ASM contained in archive : VCCRT1.ZIP
page ,132
title unlink - unlink a file
;***
;unlink.asm - unlink (delete) a file
;
; Copyright (c) 1987-1992, Microsoft Corporation. All rights reserved.
;
;Purpose:
; defines unlink() - unlink/delete a file
;
;*******************************************************************************

include version.inc
.xlist
include cmacros.inc
include msdos.inc
.list

sBegin code

extrn __dosret0:near

assumes cs,code

page
;***
;int _unlink(path), int remove(path) - unlinks (deletes) a file
;
;Purpose:
; Unlinks/deletes a file.
;
;Entry:
; char *path - file to delete
;
;Exit:
; returns 0 if successful
; returns -1 and sets errno if unsuccessful
;
;Uses:
;
;Exceptions:
;
;*******************************************************************************

cProc remove,,<>
cBegin nogen
cEnd nogen

cProc _unlink,,<>

parmdp path

cBegin

if sizeD
push ds
lds dx,path ; get file name
else
mov dx,path ; get file name
endif
callos delete ; delete file
if sizeD
pop ds
endif
jmp __dosret0 ; return 0 if successful

cEnd nogen

sEnd
end


  3 Responses to “Category : C++ Source Code
Archive   : VCCRT1.ZIP
Filename : UNLINK.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/