/***************************************************************************
                          size_file.c  -  description
                             -------------------
    begin                : lun ago 26 2002
    copyright            : (C) 2002 by deabru
    email                : deabru@nubbis.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>

double size_file (char FileName[])
{
	struct stat stat_p;
	long result = -1;

/*	printf("\nmidiendo fichero %s\n",FileName);*/

	if ( -1 ==  stat (FileName, &stat_p))
	{
		/*printf(" Error occoured attempting to stat %s\n", FileName);*/
		result = -1;
	}
	else
	{
		result = stat_p.st_size;
	}
  
	return result;
}