MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / stat

Function stat

components/dfs/dfs_v2/src/dfs_posix.c:526–543  ·  view source on GitHub ↗

we can not implement these functions */ * this function is a POSIX compliant version, which will get file information. * * @param file the file name * @param buf the data buffer to save stat description. * * @return 0 on successful, -1 on failed. */

Source from the content-addressed store, hash-verified

524 * @return 0 on successful, -1 on failed.
525 */
526int stat(const char *file, struct stat *buf)
527{
528 int result;
529
530 if (file == NULL || buf == NULL)
531 {
532 rt_set_errno(EBADF);
533 return -1;
534 }
535
536 result = dfs_file_stat(file, buf);
537 if (result < 0)
538 {
539 rt_set_errno(-result);
540 }
541
542 return result;
543}
544RTM_EXPORT(stat);
545
546/**

Callers 2

utimensatFunction · 0.70
accessFunction · 0.70

Calls 2

rt_set_errnoFunction · 0.85
dfs_file_statFunction · 0.70

Tested by

no test coverage detected