I'm trying to get file size in c programming using seek.
(我正在尝试使用seek在c编程中获取文件大小。)
I can't use fseek
, stat.size nor ftell
, there's a custom operating system UNIX in which I need to run. (我不能使用fseek
,stat.size或ftell
,我需要在其中运行自定义操作系统UNIX。)
How can I find out filesize just by using seek?
(如何仅通过使用seek找出文件大小?)
Is it possible? (可能吗?)
FILE *fd = open(argv[1], "r");
if(fd == NULL)
{
printf("Not able to open the file : %s
", argv[1]);
return;
}
// Set the pointer to the end
seek(fd, 0, SEEK_END);
ask by Abhilash Muthuraj translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…