Boost logo

Boost :

Subject: [boost] [afio] Trouble with examples
From: Brian Ravnsgaard Riis (lists_at_[hidden])
Date: 2015-05-03 15:02:51


Hi,

The first two examples for the AFIO library do not work as written.

The "Hello World" example is missing a file_flag::Create[OnlyIfNotExist]
flag on the "example_file.txt" op. Otherwise it never creates the file
and the rest of the example becomes garbage.

The "less toy" example has a bug in the parsing of the input files. It
loops, incrementing argc instead of n, as it should. Even after that I
cannot get the program to work, and I am unsure exactly what is wrong.
The output file for the concatenated inputs is created and "truncated"
to the correct size, but no data ever gets written to this file. If I
use large files I have seen std::invalid_argument exceptions and even
segfaults. I *think* the problem may be related to the buffers; I have
tried using a simple std::vector<char> for the file_buffer_type, but
this makes no difference.

I have not looked at any other examples yet; I think I should get these
two working correctly first...

Regards,
  Brian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk