1 /*- 2 * Copyright (c) 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 getfile(prompt, mode) 11 char *prompt; 12 int mode; 13 { 14 int fd; 15 char buf[100]; 16 17 do { 18 printf("%s: ", prompt); 19 gets(buf); 20 } while ((fd = open(buf, mode)) < 0); 21 22 return (fd); 23 } 24