+void DataTool::do_unpack()
+{
+ DataFile::PackSource source;
+ for(list<string>::const_iterator i=in_fns.begin(); i!=in_fns.end(); ++i)
+ source.add_pack_file(*i);
+
+ list<DataFile::PackSource::FileInfo> files = source.list_files();
+ for(list<DataFile::PackSource::FileInfo>::const_iterator i=files.begin(); i!=files.end(); ++i)
+ {
+ IO::Seekable *in = source.open(i->name);
+ IO::Base *out = open_output(i->name);
+ char buf[16384];
+ while(1)
+ {
+ unsigned len = in->read(buf, sizeof(buf));
+ out->write(buf, len);
+ if(len<sizeof(buf))
+ break;
+ }
+ delete in;
+ delete out;
+ }
+}
+