int add_input_file(char *path)
{
int i;
FILE *f;
if (in_files_count >= MAX_IN_FILES) return(-1);
i = access(path, R_OK | F_OK);
if (i != 0) {
printf("Can not access file: %s\n", path);
return(HPI_SHELL_PARM_ERROR);
};
f = fopen(path, "r");
if (f == (FILE *)NULL) {
printf("Can not open file: %s\n", path);
return(HPI_SHELL_PARM_ERROR);
};
input_files[in_files_count] = f;
in_files_count++;
input_file = f;
return(0);
}
阅读(201) | 评论(0) | 转发(0) |