Bad file descriptor in File destructor

unDEFER via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 13 01:43:26 PDT 2017


What the God? I was not ready to post...

     File file;
     try {
         file = File(path);
     }
     catch (Exception exp)
     {
         return;
     }

     try {
         //Some actions with file
     }
     catch (ErrnoException)
     {
         return;
     }


catch (ErrnoException) is necessary because there is sometimes 
"Bad file descriptor" error.
But now I have "Bad descriptior" in destructor. Where I must put 
my try/catch section to avoid it?

Thank you!


More information about the Digitalmars-d-learn mailing list