68 return c ==
L'\\' ||
c ==
L'/';
92static
wchar_t*
__cdecl call_wfullpath(
115 return *buffer_result;
150 wchar_t const*
const path_start = has_drive_letter_and_colon
154 if (path_start[0] ==
L'\0')
159 if (
is_slash(path_start[0]) && path_start[1] ==
L'\0')
168 int const attributes,
169 wchar_t const*
const path
172 unsigned const os_mode = attributes & 0xff;
192 stat_mode |= (stat_mode & 0700) >> 3;
193 stat_mode |= (stat_mode & 0700) >> 6;
210 if (
path[2] ==
L'\0')
237 wchar_t const*
p =
path + 2;
245 if (
p[0] ==
L'\0' ||
p[1] ==
L'\0')
256 if (
p[0] ==
L'\0' ||
p[1] ==
L'\0')
268 __crt_unique_heap_ptr<wchar_t, __crt_public_free_policy> full_path_pointer;
269 wchar_t*
const full_path = call_wfullpath(
273 full_path_pointer.get_address_of());
275 if (full_path ==
nullptr)
289template <
typename TimeType>
292 TimeType
const fallback_time
297 if (file_time.dwLowDateTime == 0 && file_time.dwHighDateTime == 0)
299 return fallback_time;
316 return time_traits::loctotime(
326template <
typename StatStruct>
328 wchar_t const*
const path,
354 result.st_mtime = time_traits::loctotime(1980, 1, 1, 0, 0, 0, -1);
360template <
typename StatStruct>
362 wchar_t const*
const path,
368 using time_type =
decltype(
result.st_mtime);
388 result.st_rdev =
static_cast<unsigned>(fh);
389 result.st_dev =
static_cast<unsigned>(fh);
452template <
typename StatStruct>
454 wchar_t const*
const path,
494template <
typename StatStruct>
496 char const*
const path,
500 if (
path ==
nullptr) {
559template <
typename StatStruct>
574 _ASSERTE((
"Invalid file descriptor. File possibly closed by a different thread",0));
#define _CHECK_FH_CLEAR_OSSERR_RETURN(handle, errorcode, retexpr)
void __cdecl __acrt_errno_map_os_error(unsigned long)
auto __acrt_lowio_lock_fh_and_call(int const fh, Action &&action) -> decltype(action())
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 _getdrive(void)
result_buffer_count char *const _In_ int const _In_ bool const _In_ unsigned const _In_ STRFLT const _In_ bool const _Inout_ __crt_cached_ptd_host &ptd throw()
static WCHAR available[MAX_STRING_RESOURCE_LEN]
#define INVALID_HANDLE_VALUE
static DOUBLE local_time(DOUBLE time, DateInstance *date)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
DWORD WINAPI GetFileType(HANDLE hFile)
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
BOOL WINAPI SystemTimeToTzSpecificLocalTime(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation, CONST SYSTEMTIME *lpUniversalTime, LPSYSTEMTIME lpLocalTime)
static char * cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag)
_Check_return_ _CRTIMP wchar_t *__cdecl _wfullpath(_Out_writes_opt_z_(_SizeInWords) wchar_t *_FullPath, _In_z_ const wchar_t *_Path, _In_ size_t _SizeInWords)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
__forceinline int __CRTDECL __ascii_iswalpha(int const _C)
__forceinline int __CRTDECL __ascii_towlower(int const _C)
#define _VALIDATE_CLEAR_OSSERR_RETURN(expr, errorcode, retexpr)
#define _VALIDATE_RETURN_NOEXC(expr, errorcode, retexpr)
#define FILE_FLAG_BACKUP_SEMANTICS
#define ERROR_FILE_NOT_FOUND
__crt_unique_handle_t< file_handle_traits > scoped_file_handle
__crt_unique_handle_t< find_handle_traits > unique_find_handle
#define _Out_writes_z_(s)
BOOL WINAPI PeekNamedPipe(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, LPDWORD lpBytesRead, LPDWORD lpTotalBytesAvail, LPDWORD lpBytesLeftThisMessage)
#define FILE_ATTRIBUTE_READONLY
#define FILE_READ_ATTRIBUTES
#define FILE_SHARE_DELETE
#define FILE_ATTRIBUTE_DIRECTORY
static FILE * file_handle
_Check_return_opt_ _CRTIMP int __cdecl _close(_In_ int _FileHandle)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
FD_TYPE file_type(FDSC **curr, char *fixed)
static bool __cdecl is_slash(wchar_t const c)
static bool __cdecl is_root_unc_name(wchar_t const *const path)
static bool __cdecl get_drive_number_from_path(wchar_t const *const path, int &drive_number)
int __cdecl _fstat64(int const fh, struct _stat64 *const result)
static bool __cdecl has_executable_extension(wchar_t const *const path)
static bool __cdecl is_root_or_empty(wchar_t const *const path)
static bool __cdecl common_stat_handle_file_opened(wchar_t const *const path, int const fh, HANDLE const handle, StatStruct &result)
static TimeType __cdecl convert_filetime_to_time_t(FILETIME const file_time, TimeType const fallback_time)
int __cdecl _wstat64(wchar_t const *const path, struct _stat64 *const result)
static int __cdecl common_stat(wchar_t const *const path, StatStruct *const result)
wchar_t const *const size_t const buffer_size
int __cdecl _fstat32i64(int const fh, struct _stat32i64 *const result)
int __cdecl _wstat64i32(wchar_t const *const path, struct _stat64i32 *const result)
wchar_t const *const size_t const _Inout_ wchar_t **const buffer_result throw()
static int __cdecl common_fstat(int const fh, StatStruct *const result)
static bool __cdecl is_usable_drive_or_unc_root(wchar_t const *const path)
static bool __cdecl compute_size(BY_HANDLE_FILE_INFORMATION const &file_info, long &size)
int __cdecl _wstat32i64(wchar_t const *const path, struct _stat32i64 *const result)
static bool __cdecl common_stat_handle_file_not_opened(wchar_t const *const path, StatStruct &result)
static unsigned short __cdecl convert_to_stat_mode(int const attributes, wchar_t const *const path)
int __cdecl _fstat32(int const fh, struct _stat32 *const result)
int __cdecl _wstat32(wchar_t const *const path, struct _stat32 *const result)
wchar_t const *const path
static bool close(_In_ type const fh)
static type get_invalid_value()
static type get_invalid_value()
static bool close(_In_ type const handle)
DWORD WINAPI GetLastError(void)
#define FILE_TYPE_UNKNOWN