return result;
}/*}}}*/
-#if 0
PW32IO int php_win32_ioutil_mkdir_w(const wchar_t *path, mode_t mode)
{/*{{{*/
- int ret = 0;
- DWORD err = 0;
+ size_t path_len;
+ const wchar_t *my_path;
- PHP_WIN32_IOUTIL_CHECK_PATH_W(path, -1, 0)
-
- /* TODO extend with mode usage */
- if (!CreateDirectoryW(path, NULL)) {
- err = GetLastError();
- ret = -1;
- SET_ERRNO_FROM_WIN32_CODE(err);
+ if (!path) {
+ SET_ERRNO_FROM_WIN32_CODE(ERROR_INVALID_PARAMETER);
+ return -1;
}
- return ret;
-}/*}}}*/
-#endif
-
-PW32IO int php_win32_ioutil_mkdir(const char *path, mode_t mode)
-{/*{{{*/
- size_t pathw_len = 0;
- wchar_t *pathw = php_win32_ioutil_conv_any_to_w(path, 0, &pathw_len);
- int ret = 0;
- DWORD err = 0;
+ PHP_WIN32_IOUTIL_CHECK_PATH_W(path, -1, 0)
- if (pathw_len < _MAX_PATH && pathw_len >= _MAX_PATH - 12) {
+ path_len = wcslen(path);
- if (path_len < _MAX_PATH && path_len > _MAX_PATH - 12) {
++ if (path_len < _MAX_PATH && path_len >= _MAX_PATH - 12) {
/* Special case here. From the doc:
"When using an API to create a directory, the specified path cannot be