radare2/libr/io/t/cat.c
pancake 3ab9e61c22 * Do not show registers if sync fails
* More work on the io refactoring
2011-01-21 09:17:14 +01:00

24 lines
455 B
C

/* radare - LGPL - Copyright 2009-2011 pancake<nopcode.org> */
#include <r_io.h>
int main(int argc, char **argv) {
struct r_io_t *io;
char buf[4096];
int ret;
RIODesc *fd;
io = r_io_new();
if (io == NULL)
return 1;
fd = r_io_open(io, argc>1?argv[1]:"/etc/issue", R_IO_READ, 0);
memset(buf, '\0', 4096);
//r_io_set_fd(&io, fd);
r_io_read (io, (ut8*)buf, sizeof (buf));
puts(buf);
ret = r_io_close(io, fd);
r_io_free (io);
return ret;
}