Hi,
I am writing a program in C. My program deals a lot with file opening (and therefore file closing), because it has several looping as well.
Basically, at some point, it fails to open a file that "physically" exist. I looked into the fd part of the process (ie. cd /proc/10128, cd fd, ls). I see a lot of numbers (representating the file descriptors i suppose).
I was wondering, if i call fclose for every fopen, then should the list of file descriptors (the number in "fd" directory of the process) be reduced?
I hope someone can give me some suggestions/comments on what could have happen to my program that makes it fails to open a file that does exist.
Thanks,
Sakura
I am writing a program in C. My program deals a lot with file opening (and therefore file closing), because it has several looping as well.
Basically, at some point, it fails to open a file that "physically" exist. I looked into the fd part of the process (ie. cd /proc/10128, cd fd, ls). I see a lot of numbers (representating the file descriptors i suppose).
I was wondering, if i call fclose for every fopen, then should the list of file descriptors (the number in "fd" directory of the process) be reduced?
I hope someone can give me some suggestions/comments on what could have happen to my program that makes it fails to open a file that does exist.
Thanks,
Sakura