Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1085 | pj | 1 | /* |
2 | * |
||
3 | * |
||
4 | * |
||
5 | */ |
||
6 | |||
7 | #include <ll/i386/cons.h> |
||
8 | #include <drivers/keyb.h> |
||
9 | |||
10 | #include <stdio.h> |
||
11 | #include <string.h> |
||
12 | |||
13 | int main(int argc,char *argv[]) |
||
14 | { |
||
15 | char buffer[256]; |
||
16 | FILE *fin; |
||
17 | int res; |
||
18 | int c; |
||
19 | |||
20 | /* |
||
21 | temp_device=bdev_scan_devices(choose_temp_callback); |
||
22 | if (temp_device<0) { |
||
23 | cprintf("can't find a filesystem to mount on /TEMP!!!\n"); |
||
24 | return -1; |
||
25 | } |
||
26 | |||
27 | res=mount(temp_device,FS_MSDOS,"/TEMP",NULL); |
||
28 | if (res!=0) { |
||
29 | cprintf("can't mount XXX on /TEMP (errno: %i)\n",errno); |
||
30 | sys_end(); |
||
31 | return -1; |
||
32 | } |
||
33 | */ |
||
34 | |||
35 | /* |
||
36 | * |
||
37 | */ |
||
38 | |||
39 | fin=NULL; |
||
40 | |||
41 | cprintf("opening...\n"); |
||
42 | fin=fopen("/TEMP/ALFA1.TXT","r"); |
||
43 | cprintf("opened!\n"); |
||
44 | |||
45 | cprintf("res=%p\n",fin); |
||
46 | |||
47 | if (fin!=NULL) { |
||
48 | |||
49 | while (!feof(fin)) { |
||
50 | |||
51 | memset(buffer,'@',sizeof(buffer)); |
||
52 | |||
53 | cprintf("reading...\n"); |
||
54 | res=fread(buffer,1,sizeof(buffer)-1,fin); |
||
55 | cprintf("read!\n"); |
||
56 | |||
57 | cprintf("res=%i\n",res); |
||
58 | buffer[res<sizeof(buffer)-1?res:sizeof(buffer)-1]='\0'; |
||
59 | cprintf("'%s'\n",buffer); |
||
60 | |||
61 | } |
||
62 | |||
63 | cprintf("closing...\n"); |
||
64 | fclose(fin); |
||
65 | cprintf("closed!\n"); |
||
66 | } |
||
67 | |||
68 | cprintf("[press 'x' to exit]\n"); |
||
69 | while ((c = keyb_getch(BLOCK)) != 'x') ; |
||
70 | |||
71 | return 0; |
||
72 | } |