ReactOS 0.4.16-dev-814-g656a5dc
rmdir.cpp
Go to the documentation of this file.
1//
2// rmdir.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The _rmdir() function, which removes a directory.
7//
8#include <corecrt_internal.h>
9#include <direct.h>
11
12// Removes the directory specified by the path. The directory must be empty, it
13// must not be the current working directory, and it must not be the root of any
14// drive. Returns 0 on success; returns -1 and sets errno and _doserrno on
15// failure.
16extern "C" int __cdecl _rmdir(char const* const path)
17{
18 if (path == nullptr) {
19 return _wrmdir(nullptr);
20 }
21
23
25
26 if (cvt != 0) {
27 return -1;
28 }
29
30 return _wrmdir(wide_path.data());
31}
#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()
_Check_return_ _CRTIMP int __cdecl _wrmdir(_In_z_ const wchar_t *_Path)
static char * cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag)
Definition: fcvtbuf.c:45
int __cdecl _rmdir(char const *const path)
Definition: rmdir.cpp:16
int errno_t
Definition: corecrt.h:615