define __KERNEL_STRICT_NAMES to avoid inclusion of kernel types on systems that carry...
[cake.git] / test / filetest.c
blob627e46f3330049589c61c9a784f49e9cd36fe2ab
1 /*
2 Copyright © 1995-2002, 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 int main(void)
14 BPTR file;
15 UBYTE buffer[20];
16 LONG r1=0,r2=0,r3=0,r4=0;
18 file=Open("testfile",MODE_NEWFILE);
19 if(file)
21 r1=Write(file,"hello, world\n",13);
22 r2=Seek(file,0,OFFSET_BEGINNING);
23 r3=Read(file,buffer,19);
24 r4=Close(file);
26 if(r3>=0)
27 buffer[r3]=0;
28 printf("%ld %ld %ld %ld \'%s\'\n",r1,r2,r3,r4,buffer);
29 return 0;