Passing file handles from functions? (Changed since dmd v0.118)

AEon aeon2001 at lycos.de
Wed Sep 17 16:38:22 PDT 2008


Last coding D 3.5 years ago. I wrote functions that would return the 
file handle. But such code no longer compiles under v1.030 (it worked 
under v0.118 though). Could someone please tell me how this may be fixed.

Compiler error:
   ---
   dmd -c -w -version=db_log -O -I. aepar.d
   aepar_file.d(706): Error: identifier 'File' is not defined
   aepar_file.d(706): Error: File is used as a type
   ---

aepar.d:
   ---snip---
   File open_Read_Log( char[] logfile )    // Line 706
   {
     if( ! std.file.exists(logfile) )  exit(1);

     File lg = new File( logfile, FileMode.In );
     return lg;
   }
   ---snip---

Function call from another function:
   ---snip---
   File lg = open_Read_Log( "filename" );
   ---snip---

Thanks.

AEon




More information about the Digitalmars-d-learn mailing list