in reply to Re^3: Writing to file...
in thread Writing to file...
Yes, closedir is the "right thing to do"! Every file handle comes from a limited pool of system resources. For a 20 line program, I don't worry about it much, but as they say "your mileage may vary". If this 20 line thing is in a client-server app, well then an open file handle here and there adds up! And the application bombs!
I tutor some students at a local college and one fundamental mistake is lack of whitespace and separating "thought units", but you see that too!
I have ammended my evil 'C' ways in favor of lining up braces. I am quite sure that this is the best way and I don't understand why you don't think that it is.
Anyway I say Horray! The OP has some good code to work from and I think he/she will do a great job!
|
|---|