我正在尝试使用seek在c编程中获取文件大小.我不能使用fseek,stat.size或ftell,这是我需要运行的自定义操作系统unix.我怎样才能通过使用seek找到filesize?可能吗?谢谢!
FILE *fd = open(argv[1], "r");
if(fd == NULL)
{
printf("Not able to open the file : %s\n", argv[1]);
return;
}
// Set the pointer to the end
seek(fd, 0, SEEK_END);
Run Code Online (Sandbox Code Playgroud)