tp1
This commit is contained in:
@@ -22,15 +22,16 @@ int main(int argc, char *argv[])
|
|||||||
fd_in = open(argv[1],O_RDONLY);
|
fd_in = open(argv[1],O_RDONLY);
|
||||||
fd_out = open(argv[2],O_WRONLY|O_TRUNC|O_CREAT,0600);
|
fd_out = open(argv[2],O_WRONLY|O_TRUNC|O_CREAT,0600);
|
||||||
w = (unsigned char)strtol(argv[3],NULL,0);
|
w = (unsigned char)strtol(argv[3],NULL,0);
|
||||||
|
|
||||||
f = ; // TODO
|
f = ; // TODO
|
||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
ssize_t nb = read(fd_in,&buf,1);
|
ssize_t nb = read(fd_in,&buf,1);
|
||||||
if (nb <=0)
|
if (nb <=0)
|
||||||
break;
|
break;
|
||||||
buf ^= w;
|
|
||||||
write(fd_out,&buf,1);
|
// TODO
|
||||||
w=next(w,f);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user