在內核中讀文件大小的方法

方法一:使用struct kstat結構體和vfs_stat()函數,使用方法和功能相似於應用態的struct stat和stat()函數。 舉例:讀取文件     struct kstat stat;     char *file_path = "/text.txt";    int file_size = 0;     ret = vfs_stat(file_path, &stat);   
相關文章
相關標籤/搜索