Domin1c0's Blog

A technical blog sharing my journey in programming, development, and open source.

View on GitHub
22 July 2025

stat

by

stat 函数

获取文件属性信息(大小、权限、修改时间等)

函数原型: int stat(const char *pathname, struct stat *buf)

参数:

返回值:

struct stat st;
stat("file.txt", &st);
printf("Size: %ld bytes\n", st.st_size);
tags: 进程 - 进程相关函数