i have text file consists of name , directory of text files. example: in file name "fileoutput.txt" have followings:
desktop/textfinder/text.txt desktop/textfinder/text1.txt
now trying read file "fileoutput.txt" , doing process on text.txt , text1.txt . used file *fp = fopen("fileoutput.txt", "r"); ``readfindfile(fp);
in main , l used following code:
void readfindfile(file *fp) { int count = 1; char buff[255]; while(fscanf(fp,"%s",buff)==1 ) { file *fp1 = fopen(buff, "r"); printf("the file %s processed!\n", buff); if( fp1 == null ) { perror("error while opening file.\n"); exit(exit_failure); } rw(fp1);// doing process on text.txt , text1.txt } fclose(fp); }
when program reads fileoutput.txt cant process desktop/textfinder/text.txte , give error: not such file or directory.
could u please me solve problem?
try enter full path list of files. note windows this: c:\users\(user)\desktop\textfinder\text1.txt
and linux:
/home/(user)/desktop/textfinder/text1.txt