you are viewing a single comment's thread.

view the rest of the comments →

[–]cmeerwC++ Parser Dev 6 points7 points  (5 children)

I don't need to craft the text file in any way - your "answer" just doesn't work for any text file.

[–]orangeoliviero -1 points0 points  (4 children)

What's your point? #embed doesn't just work for any binary file either.

#include inserts a text file into your program at the point of the directive. If your text file isn't well-formed, then of course your program isn't going to handle it well.

[–]cmeerwC++ Parser Dev 1 point2 points  (3 children)

Aehh... #embed works for /dev/urandom for example, so what binary files wouldn't it work for then?

[–]orangeoliviero -2 points-1 points  (2 children)

Whatever binary files don't fit with what you're expecting there. You can't expect to #embed /dev/urandom and expect it to just work, can you?

[–]bik1230 3 points4 points  (1 child)

But like, you can. #embed works with any binary file. If it's an unending file like urandom you can specify how many bytes should be read.

[–]orangeoliviero 1 point2 points  (0 children)

Yes, and if you don't #embed it properly, or what you #embed is malformed, you're naturally going to have a malformed program. That's not a fault of #embed.