MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_file_size

Function cbm_file_size

src/foundation/platform.c:174–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174int64_t cbm_file_size(const char *path) {
175 wchar_t *wpath = cbm_path_to_wide(path);
176 if (!wpath) {
177 return CBM_NOT_FOUND;
178 }
179 WIN32_FILE_ATTRIBUTE_DATA fad;
180 BOOL ok = GetFileAttributesExW(wpath, GetFileExInfoStandard, &fad);
181 free(wpath);
182 if (!ok) {
183 return CBM_NOT_FOUND;
184 }
185 LARGE_INTEGER sz;
186 sz.HighPart = (LONG)fad.nFileSizeHigh; // cppcheck-suppress unreadVariable
187 sz.LowPart = fad.nFileSizeLow; // cppcheck-suppress unreadVariable
188 return (int64_t)sz.QuadPart;
189}
190
191char *cbm_normalize_path_sep(char *path) {
192 if (path) {

Calls 2

cbm_path_to_wideFunction · 0.85
statClass · 0.70