ReactOS 0.4.16-dev-814-g656a5dc
unlink.cpp
Go to the documentation of this file.
1//
2// unlink.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The remove() and unlink() functions, which remove (delete) files.
7//
8#include <corecrt_internal.h>
9#include <stdio.h>
11
12// Deletes the specified file. Returns zero if successful; returns -1 and sets
13// errno and _doserrno on failure.
14extern "C" int __cdecl remove(char const* const path)
15{
16 if (path == nullptr)
17 return _wremove(nullptr);
18
20
22
23 if (cvt != 0) {
24 return -1;
25 }
26
27 return _wremove(wide_path.data());
28}
29
30
31
32extern "C" int __cdecl _unlink(char const* const path)
33{
34 return remove(path);
35}
#define __cdecl
Definition: accygwin.h:79
errno_t __acrt_mbs_to_wcs_cp(char const *const null_terminated_input_string, __crt_win32_buffer< wchar_t, ResizePolicy > &win32_buffer, unsigned int const code_page)
unsigned int __acrt_get_utf8_acp_compatibility_codepage()
static char * cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag)
Definition: fcvtbuf.c:45
_Check_return_ _CRTIMP int __cdecl _wremove(_In_z_ const wchar_t *_Filename)
int remove
Definition: msacm.c:1366
int errno_t
Definition: corecrt.h:615