|
-
Aug 3rd, 2000, 09:29 AM
#1
Thread Starter
Hyperactive Member
Anyone know how to in c determine the size of a file in bits? or bytes?
-
Aug 3rd, 2000, 09:32 AM
#2
Thread Starter
Hyperactive Member
Nevermind, have it figured, just got to use stat...
-
Aug 15th, 2000, 01:15 PM
#3
New Member
follow this code
long fsize(char * filename)
{
FILE *fp;
long lSize;
char c;
fp = fopen(filename, "r");
for(lSize = 0;(c = fgetc(fp)) != EOF; lSize++)
;
fclose(fp);
return ( lSize );
}
-
Aug 15th, 2000, 03:55 PM
#4
Thread Starter
Hyperactive Member
could also use
_filelength(handle of file)
this will return the number of bytes the file is.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|