1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
int main(int argc,char *argv[])
{
if(argc!=3)
{ printf("Le nombre d'argument en entrée est incorrecte\nla syntaxe correcte est ' ./tri fichier1 fichier2 '\n");
exit(1);
}
struct stat *buf;
int fd1,fd2,a,taille;
char *chaine; //char *chaines[];
fd1=open(argv[1],O_RDONLY);
if(stat(argv[1],buf)==-1)
{ perror("stat");
exit(1);
}
taille=buf->off_t;
.....
............
.........
return 0;
} |