Changeset a35b458 in mainline for uspace/app/tester/stdio/stdio1.c
- Timestamp:
- 2018-03-02T20:10:49Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/stdio/stdio1.c
r3061bc1 ra35b458 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.