
25 Feb
2011
25 Feb
'11
12:22 p.m.
Hi, I would like to know if there exists a way to check for a given file if it is actually a serialized archive or a pure txt-file, at best without the need to read in that file completely. At the moment, I use boost::serialization to store self-defined class-instances in txt-files, so using something like the system's "file"-command would not bring me far. Now I would like my program to distinguish if the provided input-argument is a text-file that needs to be parsed or if it can simply restore this previous instance. Of course, using a separate option indicating if an archive was passed would work, but IMHO is not very beautiful. Best, Cedric