Changes in uspace/app/tester/stdio/stdio1.c [a35b458:9af1c61] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/stdio/stdio1.c
ra35b458 r9af1c61 42 42 FILE *file; 43 43 const char *file_name = "/textdemo"; 44 44 45 45 TPRINTF("Open file \"%s\"...", file_name); 46 46 errno = 0; … … 51 51 } else 52 52 TPRINTF("OK\n"); 53 53 54 54 TPRINTF("Read file..."); 55 55 size_t cnt = fread(buf, 1, BUF_SIZE, file); … … 60 60 } else 61 61 TPRINTF("OK\n"); 62 62 63 63 buf[cnt] = '\0'; 64 64 TPRINTF("Read %zu bytes, string \"%s\"\n", cnt, buf); 65 65 66 66 TPRINTF("Seek to beginning..."); 67 67 if (fseek(file, 0, SEEK_SET) != 0) { … … 71 71 } else 72 72 TPRINTF("OK\n"); 73 73 74 74 TPRINTF("Read using fgetc()..."); 75 75 while (true) { … … 77 77 if (c == EOF) 78 78 break; 79 79 80 80 TPRINTF("."); 81 81 } 82 82 TPRINTF("[EOF]\n"); 83 83 84 84 TPRINTF("Close..."); 85 85 if (fclose(file) != 0) { … … 88 88 } else 89 89 TPRINTF("OK\n"); 90 90 91 91 return NULL; 92 92 }
Note:
See TracChangeset
for help on using the changeset viewer.