arosc.library: Compiler delint
[AROS.git] / test / dos / examinefh.c
blobbcecf56eb602f82186c6780177b679a5e5becbad
1 #include <dos/dos.h>
2 #include <proto/dos.h>
3 #include <stdio.h>
5 int main(int argc, char **argv)
7 BPTR fh;
9 if (argc < 2)
11 printf("Usage: %s <file name>\n", argv[0]);
12 return 1;
15 fh = Open(argv[1], MODE_OLDFILE);
17 if (fh != BNULL)
19 struct FileInfoBlock *fib;
21 printf("IsInteractive: %d\n", (int)IsInteractive(fh));
23 fib = AllocDosObject(DOS_FIB, NULL);
24 if (fib != NULL)
26 if (ExamineFH(fh, fib))
28 printf("Got FIB:\n");
29 printf("Filename = %s\n" , fib->fib_FileName);
30 printf("Protection = 0x%08X\n", (unsigned)fib->fib_Protection);
32 else
34 printf("examinefh failed, ioerr = %d\n", (int)IoErr());
36 FreeDosObject(DOS_FIB, fib);
38 else
40 printf("couldn't allocate fileinfoblock\n");
43 Close(fh);
45 else
47 printf("Couldn't open file\n");
50 return 0;