Im not sure how to print the size of each file in this directory?
any ideas?
the only way i know is using ftell, which im not sure if i can use it in this situation.
Code:
#include <dirent.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main(void)
{
DIR *d;
struct dirent *dir;
char *folder = "C:\\j\\ftp\\home\\movies";
int MB = 1048576;
long size;
d = opendir(folder);
if(d)
{
while((dir = readdir(d)) != NULL)
{
if(strcmp(dir->d_name, ".") != 0 && strcmp(dir->d_name, "..") != 0)
{
//print size here
}
}
closedir(d);
}
getch();
return 0;
}