Changes in uspace/app/tester/stdio/stdio2.c [9af1c61:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/stdio/stdio2.c
r9af1c61 ra35b458 38 38 FILE *file; 39 39 const char *file_name = "/test"; 40 40 41 41 TPRINTF("Open file \"%s\" for writing...", file_name); 42 42 errno = 0; … … 47 47 } else 48 48 TPRINTF("OK\n"); 49 49 50 50 TPRINTF("Write to file..."); 51 51 fprintf(file, "integer: %u, string: \"%s\"", 42, "Hello!"); 52 52 TPRINTF("OK\n"); 53 53 54 54 TPRINTF("Close..."); 55 55 if (fclose(file) != 0) { … … 58 58 } else 59 59 TPRINTF("OK\n"); 60 60 61 61 TPRINTF("Open file \"%s\" for reading...", file_name); 62 62 file = fopen(file_name, "rt"); … … 66 66 } else 67 67 TPRINTF("OK\n"); 68 68 69 69 TPRINTF("File contains:\n"); 70 70 while (true) { … … 74 74 TPRINTF("%c", c); 75 75 } 76 76 77 77 TPRINTF("\nClose..."); 78 78 if (fclose(file) != 0) { … … 81 81 } else 82 82 TPRINTF("OK\n"); 83 83 84 84 return NULL; 85 85 }
Note:
See TracChangeset
for help on using the changeset viewer.