MCPcopy Create free account
hub / github.com/WinMerge/winmerge / mywstat

Function mywstat

Src/diffutils/src/mystat.cpp:70–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70extern "C" int mywstat(const wchar_t *filename, struct _stat64 *buf)
71{
72 if (buf == nullptr)
73 {
74 errno = EINVAL;
75 return -1;
76 }
77 if (wcspbrk(filename, L"*?") != nullptr)
78 {
79 errno = ENOENT;
80 return -1;
81 }
82 WIN32_FIND_DATAW ffd;
83 HANDLE hFindFile = FindFirstFileW(filename, &ffd);
84 if (hFindFile == INVALID_HANDLE_VALUE)
85 {
86 errno = ENOENT;
87 return -1;
88 }
89 FindClose(hFindFile);
90 memset(buf, 0, sizeof(*buf));
91 set_statbuf(ffd, *buf);
92 return 0;
93}

Callers 2

WritePatchFileMethod · 0.85
TESTFunction · 0.85

Calls 1

set_statbufFunction · 0.85

Tested by 1

TESTFunction · 0.68