/*************************************************************************/
/* Autor      : RTA                                                      */
/* Computer   : Amiga                                                    */
/* Sprache    : Ansi C                                                   */
/* Compiler   : SAS C-Compiler Version 5.1a                              */
/* Dateiname  : filelength.c                                             */
/* Projekt    : OnlineHelp                                               */
/* Erstellt am: 24 Aug 1991,14:9                                         */
/*************************************************************************/

#include "online.h"

/***************************************************************************/
/* Gibt die Länge der Datei <fname> in Bytes zurück                        */
/* Falls ein Fehler auftritt wird -1 zurückgegeben                         */
/***************************************************************************/
LONG filelength(BYTE *fname)
{
   struct FileInfoBlock __aligned fileinfo;
   struct FileLock      *lock;
   LONG                 groesse;

   if(!(lock=(struct FileLock *)Lock(fname,ACCESS_READ))) return(-1);
   Examine((BPTR)lock,&fileinfo);
   groesse=(LONG)fileinfo.fib_Size;
   UnLock((BPTR)lock);
   return(groesse);
}
