Category : C++ Source Code
Archive   : VCCRT1.ZIP
Filename : UNLINK.ASM
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
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/