36 lines
849 B
C
36 lines
849 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
|
|
char s_toin[260];
|
|
char toin[260];
|
|
FILE *filein;
|
|
int unin[1024];
|
|
int in[1024];
|
|
|
|
void openfile() {
|
|
printf("file to open...\n"); //open the file
|
|
scanf("%260s", s_toin);
|
|
printf("opening %s...\n",&toin);
|
|
snprintf(toin, sizeof(toin), "%s", s_toin); //put filename in string that fopen likes
|
|
if (access(toin, F_OK) == 0) { //does file exsist?
|
|
filein = fopen(toin, "r"); //file exsists, open it
|
|
} else {
|
|
printf("error opening %s, press any key to exit...", &toin); //file doesnt exsist, exit
|
|
getch();
|
|
exit(1);
|
|
}
|
|
|
|
fprintf(filein,"%s",*unin);
|
|
printf("fprintf\n");//debug
|
|
for (int j = 0; j < 1024; j++) {
|
|
printf()//maybe just printf a string
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
openfile();
|
|
|
|
exit(0);
|
|
}
|