Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / test / dos / examinefh.c
blobbf2722269c30902e7653a36ef84bf66d55e30a14
1 #include <dos/dos.h>
2 #include <proto/dos.h>
3 #include <stdio.h>
5 int main(void)
7 BPTR fh = Open("__TEST__", MODE_NEWFILE);
9 if (fh != NULL)
11 struct FileInfoBlock *fib = AllocDosObject(DOS_FIB, NULL);
13 if (fib != NULL)
15 if (ExamineFH(fh, fib))
17 printf("got fib. filename = %s\n", fib->fib_FileName);
19 else
21 printf("examinefh failed, ioerr = %ld\n", IoErr());
23 FreeDosObject(DOS_FIB, fib);
25 else
27 printf("couldn't allocate fileinfoblock\n");
30 Close(fh);
31 DeleteFile("__TEST__");
33 else
35 printf("couldn't create file\n");
39 return 0;