used a random block size if not given an argv[1].
[unix-history] / usr / src / sys / stand.att / getfile.c
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*
* @(#)getfile.c 7.1 (Berkeley) %G%
*/
#include "param.h"
#include "inode.h"
#include "fs.h"
#include "saio.h"
getfile(prompt, mode)
char *prompt;
int mode;
{
int fd;
char buf[100];
do {
printf("%s: ", prompt);
gets(buf);
} while ((fd = open(buf, mode)) <= 0);
return(fd);
}