MCPcopy Create free account
hub / github.com/crownengine/crown / stat

Function stat

src/core/os.cpp:92–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91#if CROWN_PLATFORM_POSIX
92 void stat(Stat &st, int fd)
93 {
94 st.file_type = Stat::NO_ENTRY;
95 st.size = 0;
96 st.mtime = 0;
97
98 struct stat buf;
99 memset(&buf, 0, sizeof(buf));
100 int err = ::fstat(fd, &buf);
101 if (err != 0)
102 return;
103
104 if (S_ISREG(buf.st_mode) == 1)
105 st.file_type = Stat::REGULAR;
106 else if (S_ISDIR(buf.st_mode) == 1)
107 st.file_type = Stat::DIRECTORY;
108
109 st.size = buf.st_size;
110 st.mtime = buf.st_mtim.tv_sec * s64(1000000000) + buf.st_mtim.tv_nsec;
111 }
112#endif // if CROWN_PLATFORM_POSIX
113
114 void stat(Stat &st, const char *path)

Callers 9

watchMethod · 0.50
watchMethod · 0.50
sizeMethod · 0.50
statMethod · 0.50
existsMethod · 0.50
is_directoryMethod · 0.50
is_fileMethod · 0.50
last_modified_timeMethod · 0.50
map_source_dirMethod · 0.50

Calls 2

memsetFunction · 0.85
FindCloseFunction · 0.85

Tested by

no test coverage detected