00001
00022 #include "ioa.h"
00023
00027
00031
00043 int Ioa_FileSize( char * pFileName )
00044 {
00045 FILE * pFile;
00046 int nFileSize;
00047 pFile = fopen( pFileName, "r" );
00048 if ( pFile == NULL )
00049 {
00050 printf( "Ioa_FileSize(): The file is unavailable (absent or open).\n" );
00051 return 0;
00052 }
00053 fseek( pFile, 0, SEEK_END );
00054 nFileSize = ftell( pFile );
00055 fclose( pFile );
00056 return nFileSize;
00057 }
00058
00070 char * Ioa_FileNameGeneric( char * FileName )
00071 {
00072 char * pDot;
00073 char * pUnd;
00074 char * pRes;
00075
00076
00077 pRes = Aig_UtilStrsav( FileName );
00078
00079
00080 pUnd = NULL;
00081 pDot = strstr( FileName, "." );
00082 if ( pUnd )
00083 pRes[pUnd - FileName] = 0;
00084 else if ( pDot )
00085 pRes[pDot - FileName] = 0;
00086 return pRes;
00087 }
00088
00100 char * Ioa_TimeStamp()
00101 {
00102 static char Buffer[100];
00103 char * TimeStamp;
00104 time_t ltime;
00105
00106 time( <ime );
00107 TimeStamp = asctime( localtime( <ime ) );
00108 TimeStamp[ strlen(TimeStamp) - 1 ] = 0;
00109 strcpy( Buffer, TimeStamp );
00110 return Buffer;
00111 }
00112
00116
00117