What the... nested fpout doesnt work?

This is a discussion on What the... nested fpout doesnt work? within the C Programming forums, part of the General Programming Boards category; Shouldn't it be _fcloseall? and not fcloseall? You can check the return value of fclose to see if the file ...

  1. #16
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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...
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  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++

Page 2 of 2 FirstFirst 12
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, 03:48 AM
  4. Why won't my OpenGL work?
    By Raigne in forum C++ Programming
    Replies: 7
    Last Post: 11-26-2005, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21