Negative

Andrew Fedoniouk news at terrainformatica.com
Mon Feb 27 11:51:57 PST 2006


> ==================================
> Logger log = getLogger();
> try {
>     File outf = getOutputFile();
>     try {
>         File inf = getInputFile();
>         try {
>             File tmpf = createTempFile();
>             try {
>                 // lots of code
>             } finally {
>                 tmpf.close();
>                 tmpf.delete();
>             }
>         } finally {
>             inf.close();
>         }
>     } finally {
>         outf.close();
>     }
> } catch (Object e) {
>     log.logFailure("...");
>     throw e;
> } finally {
>     log.close();
> }
> ==================================
>
>

This is real life example:

Logger log = getLogger();
try {
      File outf = getOutputFile(); // state managed outside
      File inf = getInputFile(); // state managed outside
      File tmpf = createTempFile();
      // lots of code
} catch (Object e)  {
      log.logFailure("...");
      throw e;
} finally {
     delete tmpf;
}
log.close();

----------------------------------
Andrew.





More information about the Digitalmars-d mailing list