| 251 | |
| 252 | |
| 253 | int 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 | |
| 280 | int PS4API sceKernelFstat(int fd, SceKernelStat *sb) |
nothing calls this directly
no test coverage detected