xref: /original-bsd/sys/stand.att/getfile.c (revision 3705696b)
1 /*
2  * Copyright (c) 1988, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)getfile.c	8.1 (Berkeley) 06/11/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