MCPcopy Create free account
hub / github.com/apache/nuttx / append_file

Function append_file

tools/kconfig2html.c:338–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336 ****************************************************************************/
337
338static void append_file(const char *filename)
339{
340 FILE *stream;
341 int ch;
342
343 /* Open the file for reading */
344
345 stream = fopen(filename, "r");
346 if (!stream)
347 {
348 error("open %s failed: %s\n", filename, strerror(errno));
349 exit(ERROR_APPENDFILE_OPEN_FAILURE);
350 }
351
352 /* Copy the file to the output */
353
354 while ((ch = getc(stream)) != EOF)
355 {
356 putc(ch, g_outfile);
357 }
358
359 /* Close and remove the file */
360
361 fclose(stream);
362 unlink(filename);
363}
364
365/****************************************************************************
366 * Name: show_usage

Callers 1

mainFunction · 0.85

Calls 8

fopenFunction · 0.85
errorFunction · 0.85
strerrorFunction · 0.85
exitFunction · 0.85
getcFunction · 0.85
putcFunction · 0.85
fcloseFunction · 0.85
unlinkFunction · 0.85

Tested by

no test coverage detected