Changes in libcfa/src/fstream.cfa [ff2a33e:65240bb]
- File:
-
- 1 edited
-
libcfa/src/fstream.cfa (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/fstream.cfa
rff2a33e r65240bb 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jul 14 11:51:10201913 // Update Count : 34 712 // Last Modified On : Fri Jul 12 12:03:53 2019 13 // Update Count : 344 14 14 // 15 15 … … 119 119 #ifdef __CFA_DEBUG__ 120 120 if ( file == 0 ) { 121 abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno);121 abort( IO_MSG "open output file \"%s\", %s", name, strerror( errno ) ); 122 122 } // if 123 123 #endif // __CFA_DEBUG__ … … 133 133 134 134 if ( fclose( (FILE *)(os.file) ) == EOF ) { 135 abort | IO_MSG "close output" | nl | strerror( errno);135 abort( IO_MSG "close output %s", strerror( errno ) ); 136 136 } // if 137 137 } // close … … 139 139 ofstream & write( ofstream & os, const char * data, size_t size ) { 140 140 if ( fail( os ) ) { 141 abort | IO_MSG "attempt write I/O on failed stream";141 abort( "attempt write I/O on failed stream\n" ); 142 142 } // if 143 143 144 144 if ( fwrite( data, 1, size, (FILE *)(os.file) ) != size ) { 145 abort | IO_MSG "write" | nl | strerror( errno);145 abort( IO_MSG "write %s", strerror( errno ) ); 146 146 } // if 147 147 return os; … … 154 154 if ( len == EOF ) { 155 155 if ( ferror( (FILE *)(os.file) ) ) { 156 abort | IO_MSG "invalid write";156 abort( "invalid write\n" ); 157 157 } // if 158 158 } // if … … 211 211 #ifdef __CFA_DEBUG__ 212 212 if ( file == 0 ) { 213 abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno);213 abort( IO_MSG "open input file \"%s\", %s\n", name, strerror( errno ) ); 214 214 } // if 215 215 #endif // __CFA_DEBUG__ … … 225 225 226 226 if ( fclose( (FILE *)(is.file) ) == EOF ) { 227 abort | IO_MSG "close input" | nl | strerror( errno);227 abort( IO_MSG "close input %s", strerror( errno ) ); 228 228 } // if 229 229 } // close … … 231 231 ifstream & read( ifstream & is, char * data, size_t size ) { 232 232 if ( fail( is ) ) { 233 abort | IO_MSG "attempt read I/O on failed stream";233 abort( "attempt read I/O on failed stream\n" ); 234 234 } // if 235 235 236 236 if ( fread( data, size, 1, (FILE *)(is.file) ) == 0 ) { 237 abort | IO_MSG "read" | nl | strerror( errno);237 abort( IO_MSG "read %s", strerror( errno ) ); 238 238 } // if 239 239 return is; … … 242 242 ifstream &ungetc( ifstream & is, char c ) { 243 243 if ( fail( is ) ) { 244 abort | IO_MSG "attempt ungetc I/O on failed stream";244 abort( "attempt ungetc I/O on failed stream\n" ); 245 245 } // if 246 246 247 247 if ( ungetc( c, (FILE *)(is.file) ) == EOF ) { 248 abort | IO_MSG "ungetc" | nl | strerror( errno);248 abort( IO_MSG "ungetc %s", strerror( errno ) ); 249 249 } // if 250 250 return is; … … 258 258 if ( len == EOF ) { 259 259 if ( ferror( (FILE *)(is.file) ) ) { 260 abort | IO_MSG "invalid read";260 abort( "invalid read\n" ); 261 261 } // if 262 262 } // if
Note:
See TracChangeset
for help on using the changeset viewer.