1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
long savepos, size;
strcat(path,lpStrPath);
strcat(path, "*.*");
hSearch=FindFirstFile(path, &File);
if (hSearch == INVALID_HANDLE_VALUE)
{
return FALSE;
}
re=TRUE;
size = 0;
do
{
/* Traitement */
savepos = ftell(fd); /* sauvegarder la position */
fseek(fd, 0, SEEK_END); /* aller en fin */
size+= ftell(fd); /* lire la taille */
fseek(fd, savepos, SEEK_SET); /* rétablir la position */
re = FindNextFile(hSearch, &File);
} while (re);
FindClose(hSearch);
return size; |