fopen returns NULL after many times do fopen and fclose, any idea?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tvnaidu
    Contributor
    • Oct 2009
    • 365

    fopen returns NULL after many times do fopen and fclose, any idea?

    My program calling a function, in that function, it does fopen and fclose, after 1000 times, fopen fails, it returns NULL in LINUX OS, where as in Windows OS I cannot see this issue, Is any limitatiion for fopen and fclose in LINUX?. thanks.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    That is not normal behaviour on Linux, perhaps you should check the value of errno when it fails.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      It is not uncommon for there to be a limit on the number of files that can be open at any given time. Are you sure you closed all the files that you opened?

      Comment

      Working...