summaryrefslogtreecommitdiffstats
path: root/util/folder/lstat_win.c
diff options
context:
space:
mode:
authormonster <[email protected]>2022-07-07 14:41:37 +0300
committermonster <[email protected]>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /util/folder/lstat_win.c
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
fix ya.make
Diffstat (limited to 'util/folder/lstat_win.c')
-rw-r--r--util/folder/lstat_win.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/util/folder/lstat_win.c b/util/folder/lstat_win.c
deleted file mode 100644
index cf94cec01ae..00000000000
--- a/util/folder/lstat_win.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <util/system/defaults.h>
-
-#ifdef _win_
- #include <util/system/winint.h>
- #include "lstat_win.h"
-
-int lstat(const char* fileName, stat_struct* fileStat) {
- int len = strlen(fileName);
- int convRes = MultiByteToWideChar(CP_UTF8, 0, fileName, len, 0, 0);
- if (convRes == 0) {
- return -1;
- }
- WCHAR* buf = malloc(sizeof(WCHAR) * (convRes + 1));
- MultiByteToWideChar(CP_UTF8, 0, fileName, len, buf, convRes);
- buf[convRes] = 0;
-
- HANDLE findHandle;
- WIN32_FIND_DATAW findBuf;
- int result;
- result = _wstat64(buf, fileStat);
- if (result == 0) {
- SetLastError(0);
- findHandle = FindFirstFileW(buf, &findBuf);
- if (findBuf.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT &&
- (findBuf.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT || findBuf.dwReserved0 == IO_REPARSE_TAG_SYMLINK))
- {
- fileStat->st_mode = fileStat->st_mode & ~_S_IFMT | _S_IFLNK;
- }
- FindClose(findHandle);
- }
- free(buf);
- return result;
-}
-
-#endif //_win_