<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Using std::fstream and PhysicsFS.</title>
		<link>http://www.allegro.cc/forums/view/614304</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 27 May 2014 07:48:51 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi there. I recently incorporated PhysFS in a project of mine to read the contents of archive (.zip) files. All was well until I attempted to load a text file using std::fstream. No matter what I tried, the text file could not be found.</p><p>My thinking is that <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_physfs_file_interface"><span class="a">al_set_physfs_file_interface</span></a><span class="k2">(</span><span class="k2">)</span></span> works only with Allegro-specific calls (such as <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_bitmap"><span class="a">al_load_bitmap</span></a><span class="k2">(</span><span class="k2">)</span></span> and <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_FILE"><span class="a">ALLEGRO_FILE</span></a></span>), but does not affect things outside of Allegro (such as std::fstream). Is my thinking correct?</p><p>I have attached an example that attempts to load a text file from an archive. It first uses std::fstream, and then ALLEGRO_FILE. ALLEGRO_FILE is successful, but std::fstream is not. On Linux, I am using <span class="source-code">g<span class="k3">+</span><span class="k3">+</span> <span class="k3">-</span>Wall <span class="k3">-</span>o test main.cpp <span class="k3">-</span>lphysfs $<span class="k2">(</span>pkg-config <span class="k3">-</span><span class="k3">-</span>libs allegro-5 allegro_physfs-5<span class="k2">)</span></span> to compile from a command line.</p><p>TL;DR: <b>Can al_set_physfs_file_interface() be used with std::fstream?</b></p><p>Thank you for your time. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Eric Johnson)</author>
		<pubDate>Tue, 27 May 2014 07:40:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It could be used if you wrote specialized fstream subclasses that work on ALLEGRO_FILE&#39;s or directly with PhysFS, but as is, no.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 27 May 2014 07:45:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank you for your swift reply, Thomas.</p><p>Okay, no worries then. ALLEGRO_FILE makes things a bit easier anyhow. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Eric Johnson)</author>
		<pubDate>Tue, 27 May 2014 07:48:51 +0000</pubDate>
	</item>
</rss>
