summaryrefslogtreecommitdiffstats
path: root/special/touchn.c
blob: 3038ebaad40727f1755a8a85b646ae9e4d80750b (plain)
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
27
28
29
30
31
32
33
34
35
36
37
/*	@(#)touchn.c	1.2 98/10/26 Connectathon Testsuite	*/
/*
 *  touch n files
 */

#if defined (DOS) || defined (WIN32)
#define DOSorWIN32
#endif

#ifndef DOSorWIN32
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#endif /* DOSorWIN32 */

#include "../tests.h"

main(argc,argv)
char **argv;
{
	int n;
	char buf[1024];

	if (argc != 2) {
		printf("usage: %s count\n", argv[0]);
		exit(1);
	}
	n = atoi(argv[1]);
	for (; n; n--) {
		sprintf(buf, "name%d", n);
		close(creat(buf, 0666));
	}
	exit(0);
}