Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
4
Добавлен:
26.05.2014
Размер:
539 б
Скачать
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <fcntl.h>
#include <string.h>

static	int	ctrl_c(int);

int	main(int argc,char *argv[])
{
char	*c;
char	st[8];
int	f_out;
int	num;
if (argc>=2){
signal(SIGINT,(void *)&ctrl_c);

printf("writing  %s in %s\n",argv[1],argv[2]);
f_out=open(argv[2],O_WRONLY | O_CREAT | O_TRUNC ,0666);
c=argv[1];

while (1)
{
write(f_out,c,strlen(c));
}

printf("finished\nfound %d\n",num);
close(f_out);
return 0;
}
}

static	int	ctrl_c(int sig)
{
signal(SIGINT,(void *)&ctrl_c);
exit(0);
}
Соседние файлы в папке Kuzmin
  • #
    26.05.201411.07 Кб4a.out
  • #
    26.05.2014539 б4l.c
  • #
    26.05.2014559 б4lab1.c
  • #
    26.05.2014323 б4lab2.c
  • #
    26.05.201475 б4lab2.dat
  • #
    26.05.201424 б4lab2.res
  • #
    26.05.2014622 б4lab3.c