ReactOS 0.4.16-dev-2104-gb84fa49
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}
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()
int CDECL _wremove(const wchar_t *path)
Definition: file.c:4965
int errno_t
Definition: corecrt.h:249
#define __cdecl
Definition: corecrt.h:121
static char * cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag)
Definition: fcvtbuf.c:45
int remove
Definition: msacm.c:1366