ReactOS
0.4.16-dev-1020-gf135cab
mkdir.cpp
Go to the documentation of this file.
1
//
2
// mkdir.cpp
3
//
4
// Copyright (c) Microsoft Corporation. All rights reserved.
5
//
6
// The _mkdir() function, which creates a directory.
7
//
8
#include <
corecrt_internal.h
>
9
#include <direct.h>
10
#include <
corecrt_internal_win32_buffer.h
>
11
12
// Creates a directory. Returns 0 on success; returns -1 and sets errno and
13
// _doserrno on failure.
14
extern
"C"
int
__cdecl
_mkdir
(
char
const
*
const
path
)
15
{
16
if
(
path
==
nullptr
) {
17
return
_wmkdir
(
nullptr
);
18
}
19
20
__crt_internal_win32_buffer<wchar_t>
wide_path;
21
22
errno_t
const
cvt
=
__acrt_mbs_to_wcs_cp
(
path
, wide_path,
__acrt_get_utf8_acp_compatibility_codepage
());
23
24
if
(
cvt
!= 0) {
25
return
-1;
26
}
27
28
return
_wmkdir
(wide_path.
data
());
29
}
__cdecl
#define __cdecl
Definition:
accygwin.h:79
__crt_win32_buffer
Definition:
corecrt_internal_win32_buffer.h:152
__crt_win32_buffer::data
char_type * data()
Definition:
corecrt_internal_win32_buffer.h:246
corecrt_internal.h
corecrt_internal_win32_buffer.h
__acrt_mbs_to_wcs_cp
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)
Definition:
corecrt_internal_win32_buffer.h:619
__acrt_get_utf8_acp_compatibility_codepage
unsigned int __acrt_get_utf8_acp_compatibility_codepage()
Definition:
corecrt_internal_win32_buffer.h:422
_wmkdir
_Check_return_ _CRTIMP int __cdecl _wmkdir(_In_z_ const wchar_t *_Path)
cvt
static char * cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag)
Definition:
fcvtbuf.c:45
_mkdir
int __cdecl _mkdir(char const *const path)
Definition:
mkdir.cpp:14
path
Definition:
wbemprox_private.h:188
errno_t
int errno_t
Definition:
corecrt.h:615
sdk
lib
ucrt
filesystem
mkdir.cpp
Generated on Mon Apr 21 2025 06:16:01 for ReactOS by
1.9.6