home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------*
- * filename - remove.cas
- *
- * function(s)
- * remove - deletes a file
- *-----------------------------------------------------------------------*/
-
- /*
- * C/C++ Run Time Library - Version 5.0
- *
- * Copyright (c) 1987, 1992 by Borland International
- * All Rights Reserved.
- *
- */
-
-
- #pragma inline
- #include <asmrules.h>
- #include <dos.h>
- #include <_io.h>
-
- /*-----------------------------------------------------------------------*
-
- Name remove - deletes a file
-
- Usage int remove(const char *filename);
-
- Related
- functions usage int remove(const char *filename);
-
- Prototype in dos.h
-
- Description remove deletes a file specified by filename. Any
- MS-DOS drive, path, and file name may be used as a filename.
- Wildcards are not allowed.
-
- Read-only files cannot be deleted by this call. To remove
- read-only files, first use chmod or _chmod to change the
- read-only attribute.
-
-
- Return value On successful completion, a 0 is returned. On
- error, a -1 is returned, and errno is set to one of the
- following values:
-
- ENOENT Path or file name not found
- EACCES Permission denied
-
- *------------------------------------------------------------------------*/
- int _CType remove(const char *filename)
- {
- pushDS_
- asm mov ah, 041h
- asm LDS_ dx, filename
- asm int 021H
- popDS_
- asm jc removeFailed
- return(0);
-
- removeFailed:
- return __IOerror(_AX);
- }
-