我有这个代码片段:
struct stat *fileData;
if((fd=open("abc.txt",O_RDONLY)==-1)
perror("file not opened");
if((fstat(fd,fileData)==-1)
perror("stucture not filled");
printf("%d",fileData.st_size);
它向我显示错误:
request for member ‘st_size’ in something not a structure or union
我也试过使用stat
。