Metropoli BBS
VIEWER: rmdir.asm MODE: TEXT (ASCII)
;******************************************************************************
; Filename: RMDIR.ASM
;   Author: Peter Andersson
;  Version: 0.0
;  Created: 1995.03.10
;  Updated: 
;******************************************************************************
; Copyright Peter Andersson, 1994-1995.
; All rights reserved.
;******************************************************************************
; Function: LONG @rmdir(PSZ path)
;  Comment: Removes a directory
;    Input: Eax,path - file path
;  Returns: -1 if an error occured or 0 if everything is alright
;******************************************************************************

        Include STDDEF.INC

        Codeseg

Proc    rmdir ,1
                Mov     Edx,Eax
                Mov     Ah,3Ah
                Int     21h
                Jc      @@Error
                Clear   Eax
                Ret
        Align   4
@@Error:        Mov     [Word errno],Ax
        Ifdef   DEBUG
                Call    printf,Offset ErrRmdirMsg,Edx,Ax
        Endif
                Mov     Eax,-1
                Ret
Endp

        Dataseg

        IfDef   DEBUG
ErrRmdirMsg     Db      "Error changing directory '%s'! Error: %h",LF,0
        Endif

        End

[ RETURN TO DIRECTORY ]