Thread: What the... nested fpout doesnt work?

  1. #16
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Shouldn't it be _fcloseall? and not fcloseall?

    You can check the return value of fclose to see if the file was really closed.
    I'd add the tracing to see in the log that the actual number of fopen calls is equal to fclose calls...

    You can miss some place where fclose is called on some condition, and otherwise the file is left opened...
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  2. #17
    1ST » R. vd Kooij
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    154

    Thumbs up

    Quote Originally Posted by vart View Post
    Shouldn't it be _fcloseall? and not fcloseall?
    Oh my god..... that's it indeed and it works!! Thanks so much!!!

    But... what does this mean? Was there still some fopen left unclosed? Or is there another function that occupies a "file-open-slot" ? How about opendir() for example?

    Thanks a whole lot anyway Vart... what a relieve to see it working, finally!!

    <3 Cboard.

    Ren&#233;
    http://www.f1rstracing.nl/
    OS: Windows XP
    Compiler: Dev-C++

  3. #18
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Was there still some fopen left unclosed?
    Check the return value of _fcloseall

    I'm not familiar with opendir function - but looking at the man page I see a closedir function - I suppose they should be called in pairs
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  4. #19
    1ST » R. vd Kooij
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    154
    Quote Originally Posted by vart View Post
    Check the return value of _fcloseall

    I'm not familiar with opendir function - but looking at the man page I see a closedir function - I suppose they should be called in pairs
    Yeah, I'm using closedir on every readdir already
    And thanks for the return value tip, it says it's 1 or 2 everytime so I suppose I'm still overlooking something. I will have a closer look at this.

    Thanks again for your time and help!
    http://www.f1rstracing.nl/
    OS: Windows XP
    Compiler: Dev-C++

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. getline() don't want to work anymore...
    By mikahell in forum C++ Programming
    Replies: 7
    Last Post: 07-31-2006, 10:50 AM
  2. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  3. Problems in getting OpenGL to work
    By zonf in forum C Programming
    Replies: 5
    Last Post: 02-13-2006, 04:48 AM
  4. Why won't my OpenGL work?
    By Raigne in forum C++ Programming
    Replies: 7
    Last Post: 11-26-2005, 11:53 AM
  5. DLL __cdecl doesnt seem to work?
    By Xei in forum C++ Programming
    Replies: 6
    Last Post: 08-21-2002, 04:36 PM