:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / lib / msvcrt / io / unlink.c
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/msvcrt/io/unlink.c
5  * PURPOSE:     Deletes a file
6  * PROGRAMER:   Boudewijn Dekker
7  * UPDATE HISTORY:
8  *              28/12/98: Created
9  */
10 #include <windows.h>
11 #include <msvcrt/io.h>
12
13 #define NDEBUG
14 #include <msvcrt/msvcrtdbg.h>
15
16
17 int _unlink(const char *filename)
18 {
19   int result = 0;
20   DPRINT("_unlink('%s')\n", filename);
21   if (!DeleteFileA(filename))
22     result = -1;
23   DPRINT("%d\n", result);
24   return result;
25 }
26
27 int _wunlink(const wchar_t *filename)
28 {
29   DPRINT("_wunlink('%S')\n", filename);
30   if (!DeleteFileW(filename))
31     return -1;
32   return 0;
33 }