mirror of
https://github.com/Alvin-Zilverstand/bob16.git
synced 2026-11-25 21:43:00 +01:00
e
This commit is contained in:
1 parent
78dd619293
commit
6dc841f956
109 files changed
+18192
-1907
No files matched your search
+14
@@ -0,0 +1,14 @@
|
||||
#include "bob.h"
|
||||
#include "bob_fs.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char text[512];
|
||||
int length;
|
||||
int i;
|
||||
if (argc != 2) { bob_puts("Usage: cat FILE"); return 1; }
|
||||
length = bob_file_read(argv[1], text, 512);
|
||||
if (length < 0) { bob_puts("Cannot read text file."); return 1; }
|
||||
for (i = 0; i < length; i++) bob_putc(text[i]);
|
||||
if(length>0&&text[length-1]!='\n')bob_putc('\n');
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user