There are only files, text and binary are artificial states of mind, free yourself. I say when embedding anything extra is just extra crap so all you really need or actually want to use is:
open
lseek
read
write
close
Opening a file and sucking it in is probably the single most time consuming slowest thing you'll ever do on a computer so I like to rip it off right up front all at once like a band-aid. 
I'd do it in C and pragma to use it from ++. Two conditions to write for, one can I read this file all at once and git'r done or do I paw through it one byte at a time building strings to parse watching for linefeeds.
CODE
    int rfile = open( path,  O_RDONLY );
    if ( rfile > 1 )
    {
        sizeofile = lseek( rfile, 0L, SEEK_END );
        lseek( rfile, 0L, SEEK_SET );
        txt = (char *)calloc( sizeofile + 1, sizeof(char));
        if ( txt != NULL )
        {
            txt[ sizeofile ] = '\0';
            actual = read( rfile, txt, sizeofile );
            if ( actual == sizeofile )
            {
                 while (  next = (char *)strtok( txt, "\n" ))
                     puts( "%s" );
             }
             else
                  fprintf( stderr, "error short read!\n" );
             free( txt );
         }
         else
              fprintf( stderr, "error allocating\n" );
         close( rfile );
    }
    else
         fprintf( stderr, "error open\n" );
}
    
Character at a time stick a while loop in there calling read til eof.
Binary, same only catch the return of read with the appropriate type pointer.
To do a cat on any size would just read char write char. Sample not compiled or claimed to.