[C con Clase] Determinar tamaño de un archivo.

Adolfo Cárdenas adocardenas en gmail.com
Lun Abr 27 19:45:07 CEST 2009


Para mi, lo más sencillo es usar: filelength
#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>
#include <stdio.h>

//ESTA FUNCION RETORNA EL TAMAÑO DE UN ARCHIVO
long SizeF(char* f)
{
  int h;
  long t;

  if((h = open(f, O_BINARY)) == -1) return -1;
  else
  {
	 t = filelength(h);
	 close(h);
  }
  return t;
}




Más información sobre la lista de distribución Cconclase