<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>how to extract all file in *.dat to disk</title>
		<link>http://www.allegro.cc/forums/view/590889</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 06 Apr 2007 19:41:16 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>if its possible to extract all file in *.dat to disk<br /><img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (stonecold)</author>
		<pubDate>Fri, 06 Apr 2007 11:37:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, use the &quot;-e *&quot;  option of the <tt>dat</tt> tool, or use the grabber.</p><p>edit: the command will look like this: <tt>dat -e yourdat.dat *</tt>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Fri, 06 Apr 2007 11:41:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>sorry,add that i mean in program
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (stonecold)</author>
		<pubDate>Fri, 06 Apr 2007 12:12:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><a href="http://www.delorie.com/djgpp/doc/libc/libc_802.html" target="_blank">system</a><span class="k2">(</span><span class="s">"dat -e yourdat.dat *"</span><span class="k2">)</span>
</pre></div></div><p>
? <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>I know, there surely is a better way, but it should still work <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CursedTyrant)</author>
		<pubDate>Fri, 06 Apr 2007 12:40:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><a href="http://www.delorie.com/djgpp/doc/libc/libc_802.html" target="_blank">system</a><span class="k2">(</span><span class="s">"dat -e yourdat.dat *"</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
But what for?<br />A datafile is meant to be used like this:<br />1. Create the datafile with either grabber or dat.<br />2. Distribute the datafile along with your executable.<br />3a. In your code, load the datafile and use the resulting DATAFILE* pointer to access the data. load_datafile() produces allegro-useable data structures directly, there&#39;s no need to call load_bitmap() or any other loading function on them.<br />3b. Alternatively, you can treat the datafile as a sort of &quot;magic&quot; folder, and access files by the following filename convention:<br />    yourdat.dat#FOO_BMP<br />For example, you could do:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a><span class="k3">*</span> my_bmp <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"yourdat.dat#FOO_BMP"</span>, NULL<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
For this to work, you DON&#39;T need to load the entire datafile.</p><p>And please (re-)read the manual, section &quot;datafile routines&quot;.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Tobias Dammers)</author>
		<pubDate>Fri, 06 Apr 2007 12:42:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Tobias said:</div><div class="quote"><p>
<span class="source-code"><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a><span class="k3">*</span> my_bmp <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"yourdat.dat#FOO_BMP"</span>, NULL<span class="k2">)</span><span class="k2">;</span></span>
</p></div></div><p>Or even:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/DATAFILE" target="_blank"><span class="a">DATAFILE</span></a> <span class="k3">*</span>dat_object <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_datafile_object" target="_blank"><span class="a">load_datafile_object</span></a><span class="k2">(</span><span class="s">"your.dat"</span>, <span class="s">"foo"</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>bmp <span class="k3">=</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span><span class="k2">)</span><span class="k2">(</span>dat_object-&gt;dat<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

Which ever.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 06 Apr 2007 12:44:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
<span class="source-code"><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a><span class="k3">*</span> my_bmp <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"yourdat.dat#FOO_BMP"</span>, NULL<span class="k2">)</span><span class="k2">;</span></span>
</p></div></div><p>
Or even:<br /><span class="source-code"><a href="http://www.allegro.cc/manual/DATAFILE" target="_blank"><span class="a">DATAFILE</span></a> <span class="k3">*</span>dat_object <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_datafile_object" target="_blank"><span class="a">load_datafile_object</span></a><span class="k2">(</span><span class="s">"your.dat"</span>, <span class="s">"foo"</span><span class="k2">)</span><span class="k2">;</span></span>
</p></div></div><p>
The former needs the bitmap stored as a binary chunk. The latter needs to be stored as a bitmap object. Just an FYI.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kitty Cat)</author>
		<pubDate>Fri, 06 Apr 2007 12:53:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>because i use audiere lib to play ogg<br />and i wanna packed ogg in DAT and use it<br />but i don&#39;t know any good method
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (stonecold)</author>
		<pubDate>Fri, 06 Apr 2007 13:10:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You may be better off using something like alogg, which integrates better with allegro. Otherwise, simply don&#39;t put ogg files into a datafile. It won&#39;t compress much anyway, and datafiles won&#39;t do much to protect your content, so there isn&#39;t really a great reason for putting an ogg file into a datafile.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Tobias Dammers)</author>
		<pubDate>Fri, 06 Apr 2007 14:06:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
so there isn&#39;t really a great reason for putting an ogg file into a datafile.
</p></div></div><p>... especially since your original question was how to get it out of the data file.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 06 Apr 2007 18:49:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, that was the original question.<br />But it makes me wonder how the ogg file got into the datafile in the first place. Either the OP put it there himself, which makes my question very valid; or someone else did, in which case I&#39;d suggest to just use grabber or dat.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Tobias Dammers)</author>
		<pubDate>Fri, 06 Apr 2007 19:41:16 +0000</pubDate>
	</item>
</rss>
