シークを使用して C プログラミングでファイル サイズを取得しようとしています。fseek
、stat.size も も使用できませんftell
。実行する必要があるカスタム オペレーティング システム UNIX があります。
シークを使用するだけでファイルサイズを調べるにはどうすればよいですか? 出来ますか?
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);