Fixed warning while generated AutoDoc documentation: NewList() is not in Exec.
[AROS.git] / test / filetest.c
blob72d3c12e1e106909a102e35bf7516b0d54c20652
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/dos.h>
7 #include <clib/exec_protos.h>
8 #include <dos/dos.h>
9 #include <clib/dos_protos.h>
10 #include <stdio.h>
12 static void hexdump(UBYTE *data, LONG len)
14 LONG i;
16 for (i = 0; i < len; i++)
17 printf("%02X ", data[i]);
19 printf("\n");
22 int main(int argc, char **argv)
24 BPTR file;
25 UBYTE buffer[20];
26 LONG r1=0,r2=0,r3=0,r4=0;
27 char *name = "testfile";
29 if (argc > 1)
30 name = argv[1];
32 file=Open(name, MODE_NEWFILE);
33 if(file)
35 r1=Write(file,"hello, world\n",13);
36 r2=Seek(file,0,OFFSET_BEGINNING);
37 r3=Read(file,buffer,19);
38 r4=Close(file);
40 if(r3>=0)
41 buffer[r3]=0;
43 printf("Results: %d %d %d %d \'%s\'\n",(int)r1,(int)r2,(int)r3,(int)r4,buffer);
44 hexdump(buffer, r3);
46 return 0;