MCPcopy Create free account
hub / github.com/Inori/GPCS4 / sceKernelStat

Function sceKernelStat

GPCS4/SceModules/SceLibkernel/sce_kernel_file.cpp:253–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251
252
253int PS4API sceKernelStat(const char *path, SceKernelStat *sb)
254{
255 LOG_SCE_TRACE("path %s sb %p", path, sb);
256 std::string pcPath = plat::PS4PathToPCPath(path);
257
258 struct _stat stat;
259 int ret = _stat(pcPath.c_str(), &stat);
260 sb->st_mode = getSceFileMode(stat.st_mode);
261 //sb->st_atim = stat.st_atime;
262 //sb->st_mtim = stat.st_mtime;
263 //sb->st_ctim = stat.st_ctime;
264 sb->st_size = stat.st_size;
265 //sb->st_birthtim = stat.st_ctime; //?
266 if (stat.st_mode & _S_IFMT & _S_IFDIR)
267 {
268 sb->st_blocks = plat::FileCountInDirectory(pcPath);
269 sb->st_blksize = sizeof(SceKernelDirent);
270 }
271 else
272 {
273 sb->st_blocks = stat.st_size / SSD_BLOCK_SIZE + (stat.st_size % SSD_BLOCK_SIZE) ? 1 : 0;
274 sb->st_blksize = SSD_BLOCK_SIZE;
275 }
276 return ret;
277}
278
279
280int PS4API sceKernelFstat(int fd, SceKernelStat *sb)

Callers

nothing calls this directly

Calls 5

PS4PathToPCPathFunction · 0.85
_statClass · 0.85
getSceFileModeFunction · 0.85
FileCountInDirectoryFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected