Copyright clean-up (part 1):
[AROS.git] / test / dos / examinefh.c
bloba144873bc29e99d567edeb44bfba642d26c403c3
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <dos/dos.h>
7 #include <proto/dos.h>
8 #include <stdio.h>
10 int main(int argc, char **argv)
12 BPTR fh;
14 if (argc < 2)
16 printf("Usage: %s <file name>\n", argv[0]);
17 return 1;
20 fh = Open(argv[1], MODE_OLDFILE);
22 if (fh != BNULL)
24 struct FileInfoBlock *fib;
26 printf("IsInteractive: %d\n", (int)IsInteractive(fh));
28 fib = AllocDosObject(DOS_FIB, NULL);
29 if (fib != NULL)
31 if (ExamineFH(fh, fib))
33 printf("Got FIB:\n");
34 printf("Filename = %s\n" , fib->fib_FileName);
35 printf("Protection = 0x%08X\n", (unsigned)fib->fib_Protection);
37 else
39 printf("examinefh failed, ioerr = %d\n", (int)IoErr());
41 FreeDosObject(DOS_FIB, fib);
43 else
45 printf("couldn't allocate fileinfoblock\n");
48 Close(fh);
50 else
52 printf("Couldn't open file\n");
55 return 0;