TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bill Birrell
from: Kurt Kuzba
date: 1998-10-14 22:29:16
subject: Size of the .EXE

/*_|_|   EXESIZE.C   PUBLIC DOMAIN   Kurt Kuzba   10/10/1998
 _|_|*/
#include 
int main(int argc, char **argv)
{
   FILE *Getsize;
   long filesize;
   short data;
   if(argc < 2)
   {
      puts("usage: exesize file.ext");
      return 1;
   }
   Getsize = fopen(argv[1], "rb");
   if(!Getsize)
   {
      printf("Could not open %s.\nusage: exesize file.ext\n", argv[1]);
      return 2;
   }
   fread(&data, sizeof(data), 1, Getsize);
   fread(&data, sizeof(data), 1, Getsize);
   filesize = data;
   fread(&data, sizeof(data), 1, Getsize);
   filesize += ((long)(data - 1) * 512L);
   printf("%s is %ld bytes long.\n", v[1], filesize);
   return 0;
}

> ] Cyberia means never having to say, "I can feel my toes!"....

---
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 810 639/252
SEEN-BY: 670/218
@PATH: 154/750 222 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.