Show
Ignore:
Timestamp:
12/07/07 06:50:47 (12 months ago)
Author:
rporter
Message:

trunk/source/cddrive.cpp
trunk/source/cdinit.cpp
trunk/source/cloudy.cpp
trunk/source/parse.h
trunk/source/parse_punch.cpp

ClosePunchFiles? now accepts boolean saying whether this is final close, then ignore clobber options. It also checks that any FITS files are the right size and complains if they are not.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/parse_punch.cpp

    r1618 r1623  
    25102510 * from cloudy before returning  
    25112511 * NB - KEEP THIS ROUTINE SYNCHED UP WITH THE PREVIOUS ONE, PunchFilesInit */ 
    2512 void ClosePunchFiles(void) 
     2512void ClosePunchFiles( bool lgFinal ) 
    25132513{ 
    25142514        long int i; 
     
    25212521        for( i=0; i < punch.npunch; i++ ) 
    25222522        { 
    2523                 if( punch.ipPnunit[i] != NULL && !lgNoClobber[i] ) 
    2524                 { 
     2523                /* if lgFinal is true, we close everything, no matter what.  
     2524                 * this means ignoring "no clobber" options */ 
     2525                if( punch.ipPnunit[i] != NULL && ( !lgNoClobber[i] || lgFinal ) ) 
     2526                { 
     2527                        /* Test that any FITS files are the right size! */  
     2528                        if( punch.lgFITS[i] ) 
     2529                        { 
     2530                                /* \todo 2 This overflows for file sizes larger (in bytes) than 
     2531                                 * a long int can represent (about 2GB on most 2007 systems)  */ 
     2532                                fseek(punch.ipPnunit[i], 0, SEEK_END); 
     2533                                long file_size = ftell(punch.ipPnunit[i]); 
     2534                                if( file_size%2880 ) 
     2535                                { 
     2536                                        fprintf( ioQQQ, " PROBLEM  FITS file is wrong size!\n" ); 
     2537                                } 
     2538                        } 
     2539 
    25252540                        fclose( punch.ipPnunit[i] ); 
    25262541                        punch.ipPnunit[i] = NULL;