xref: /original-bsd/sys/stand.att/getfile.c (revision b4971bb3)
1 /*
2  * Copyright (c) 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)getfile.c	7.8 (Berkeley) 05/24/93
8  */
9 
10 #include <sys/param.h>
11 #include <sys/time.h>
12 #include <stand.att/saio.h>
13 
14 getfile(prompt, mode)
15 	char *prompt;
16 	int mode;
17 {
18 	int fd;
19 	char buf[100];
20 
21 	do {
22 		printf("%s: ", prompt);
23 		gets(buf);
24 	} while ((fd = open(buf, mode)) <= 0);
25 	return(fd);
26 }
27