Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- int main (int argc, char *argv[])
- {
- if ( argc!=2 )
- {
- fprintf(stderr,"Usage : script <tailleBuffer>");
- exit(1);
- }
- int tailleBuf = atoi(argv[1]);
- int c;
- unsigned char* buffer = ( unsigned char* ) malloc(tailleBuf*sizeof( unsigned char ));
- while((c = read(0,buffer,tailleBuf)) > 0)
- {
- write(1,buffer,c);
- }
- free(buffer);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement