/***************************************
 *                                     *
 * Programm: FileList für ein File     *
 * =================================== *
 *                                     *
 * Autor:  Datum:      Kommentar:      *
 * ------  ----------  ----------      *
 * Wgb     17.07.1988  Examine()       *
 *                                     *
 *                                     *
 ***************************************/

#include <libraries/dos.h>

extern struct DOSLibrary *DOSBase;


main(argc, argv)
int argc;
char *argv[];
   {
   BOOL Status;
   LONG Error, IoErr();

   struct FileLock     *FileLock, *Lock();
   struct FileInfoBlock InfoBlock;

   if (argc != 2)
      {
      printf("Ich brauche genau einen File-Namen!\n");
      exit(FALSE);
      }

   FileLock = Lock(argv[1], SHARED_LOCK);

   if (FileLock == NULL)
      {
      Error = IoErr();
      printf("Es trat der Error Nr.: %ld auf!\n", Error);
      exit(FALSE);
      }

   Status = Examine(FileLock, &InfoBlock);

   if (Status == DOSFALSE)
      {
      printf("Ein Fehler beim Beschaffen der Informationen!\n");
      exit(FALSE);
      }

   printf("%-30s  ", InfoBlock.fib_FileName);

   if (InfoBlock.fib_DirEntryType >= 0)
      printf("DIR     ");
   else
      printf("%6ld  ", InfoBlock.fib_Size);

   printf("%6ld  \n", InfoBlock.fib_NumBlocks);

   UnLock(FileLock);

   exit(TRUE);
   }

