Changeset 225 in xtideuniversalbios for trunk/Serial_Server/library
- Timestamp:
- Jan 27, 2012, 6:19:21 PM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/Serial_Server/library
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Serial_Server/library/File.h
r219 r225 18 18 { 19 19 public: 20 voidCreate( char *p_name )20 int Create( char *p_name ) 21 21 { 22 22 fp = fopen( p_name, "r" ); 23 23 24 24 if( fp ) 25 log( -1, "Create Failure: '%s' already exists", p_name ); 25 { 26 log( 0, "'%s' file already exists", p_name ); 27 fclose( fp ); 28 return( 0 ); 29 } 26 30 27 31 if( !(fp = fopen( p_name, "w" )) ) … … 29 33 30 34 name = p_name; 35 36 return( 1 ); 31 37 } 32 38 -
trunk/Serial_Server/library/FlatImage.h
r219 r225 30 30 sizef = size / 2048.0; // 512 byte sectors -> MB 31 31 32 cf.Create( name );33 34 memset( &buff[0], 0, 512 );35 while( size-- )36 cf.Write( &buff[0], 512 );37 38 if( p_cyl > 1024 )39 log( 0, "Created file '%s', size %.1lf MB", name, sizef );40 else41 log( 0, "Created file '%s', geometry %u:%u:%u, size %.1lf MB", name, p_cyl, p_sect, p_head, sizef );42 43 cf.Close();32 if( cf.Create( name ) ) 33 { 34 memset( &buff[0], 0, 512 ); 35 while( size-- ) 36 cf.Write( &buff[0], 512 ); 37 38 if( p_cyl > 1024 ) 39 log( 0, "Created file '%s', size %.1lf MB", name, sizef ); 40 else 41 log( 0, "Created file '%s', geometry %u:%u:%u, size %.1lf MB", name, p_cyl, p_sect, p_head, sizef ); 42 cf.Close(); 43 } 44 44 } 45 45
Note:
See TracChangeset
for help on using the changeset viewer.