9 int id = open(
"test.xml", O_RDONLY);
11 int id_write = open(
"test_copied.xml", O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
12 assert(id_write != -1);
16 for(index=0; index<256; ++
index)
18 printf(
"check %d\n",
id);
19 printf(
"check_write %d\n", id_write);
20 res =
read(
id, buffer, 256);
21 printf(
"res %d\n", res);
22 for(index=0; index<res; ++
index)
23 printf(
"%c", buffer[index]);
26 res_index = write(id_write, buffer, res);
27 printf(
"n. bytes read=%d, n. bytes written=%d\n", res, res_index);
short int read(short int *data)