fwrlfo
1
i need to get all files names on a c file directory to I can open every file and read from them to write on other files......
I solved the problem of reading and writing for a specific file to another file ....
but i want that for text files in .c file directory so how to read a names of files 1 by 1
I searched a lot but no codes about that
I don't know what language your using(i.e. shell script, perl, vb, etc.) but the below will give you a list of files:
cd .c
for f in `ls *.txt`
do
file=`echo ${f}`
.......your code to process file.......
done
fwrlfo
3
oh sorry I forget about that... Iam talking about a c code
See the man pages for opendir() and readdir().
1 Like
fwrlfo
6
Thank you guys I don't know where you find those info...... but this is not google for sure