<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[A5] al_filename_exists() can&#39;t see file.</title>
		<link>http://www.allegro.cc/forums/view/613220</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 14 Sep 2013 20:22:43 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What I am doing is scanning a ZIP file which contains the games default levels and basically counting the number of levels available.  Then I switch out of the ZIP to the exe directory and scan for any additional user made levels so I can get an accurate count of the total number of levels available.</p><p>There are 10 levels in the zip (&quot;level001.dp2&quot; to &quot;level010.dp2&quot;) and 1 level outside the zip in the same directory as the exe named &quot;level011.dp2&quot;.  It finds the 10 inside the zip just fine, but doesn&#39;t see the one in the exe folder.  The path functions work well and get the proper path but nothing.  I switch off the physfs interface okay so I don&#39;t see where I am going wrong here.</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>   <span class="c">// Get path</span>
<span class="number">  2</span>   <span class="k1">char</span> path<span class="k2">[</span>TEXT_BUFFER<span class="k2">]</span><span class="k2">;</span>
<span class="number">  3</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_732.html" target="_blank">snprintf</a><span class="k2">(</span>path, TEXT_BUFFER, <span class="s">"%s"</span>,
<span class="number">  4</span>            <a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_RESOURCES_PATH<span class="k2">)</span>,
<span class="number">  5</span>            ALLEGRO_NATIVE_PATH_SEP<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  6</span>
<span class="number">  7</span>   <span class="k1">int</span> levelcount <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
<span class="number">  8</span>   <span class="c">// Get number of levels in the zip</span>
<span class="number">  9</span>   <span class="k1">while</span><span class="k2">(</span><span class="n">1</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 10</span>      <span class="k1">char</span> filename<span class="k2">[</span>TEXT_BUFFER<span class="k2">]</span><span class="k2">;</span>
<span class="number"> 11</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_732.html" target="_blank">snprintf</a><span class="k2">(</span>filename, TEXT_BUFFER, <span class="s">"level%03d.dp2"</span>, levelcount<span class="k3">+</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span>      <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span>filename<span class="k2">)</span><span class="k2">)</span> levelcount<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
<span class="number"> 13</span>      <span class="k1">else</span> <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 14</span>   <span class="k2">}</span>
<span class="number"> 15</span>
<span class="number"> 16</span>   <a href="http://www.allegro.cc/manual/al_set_standard_file_interface"><span class="a">al_set_standard_file_interface</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 17</span>   <span class="c">// Get the number of levels inside the exe folder</span>
<span class="number"> 18</span>   <span class="k1">while</span><span class="k2">(</span><span class="n">1</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 19</span>      <span class="k1">char</span> filename<span class="k2">[</span>TEXT_BUFFER<span class="k2">]</span><span class="k2">;</span>
<span class="number"> 20</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_732.html" target="_blank">snprintf</a><span class="k2">(</span>filename, TEXT_BUFFER, <span class="s">"%slevel%03d.dp2"</span>, path, levelcount<span class="k3">+</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 21</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Searching for %s\n"</span>, filename<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span>      <span class="k1">if</span><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span>filename<span class="k2">)</span><span class="k2">)</span> levelcount<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
<span class="number"> 23</span>      <span class="k1">else</span> <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 24</span>   <span class="k2">}</span>
<span class="number"> 25</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Levels found: %d\n"</span>, levelcount<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 26</span>   <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 class="k2">;</span>
</div></div><p>

The <span class="source-code"><a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="k2">)</span></span> shows the path and filename as being totally correct.  Also, just a little bit later in my code I load in levels for the game and they all load just fine, whether they are in the ZIP or in the main directory with the exe, no problems, they load fine.  I do the same thing in this code where I switch to the standard file interface and then open the file.  It works, no problem.  Yet in the above code, it won&#39;t file the level outside the zip no matter what I do. I tried <span class="source-code"><a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a><span class="k2">(</span><span class="k2">)</span></span> as well and nothing.  This is really strange and starting to drive me nuts! :/
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Thu, 05 Sep 2013 08:32:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You&#39;ll want to use absolute paths with those functions.</p><p>Personally I&#39;d just <span class="source-code"><a href="http://www.allegro.cc/manual/al_read_directory"><span class="a">al_read_directory</span></a></span> the dir your levels will be in, and look for level\d+.dp2 files.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 05 Sep 2013 08:54:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks.</p><p>I replaced the <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span><span class="k2">)</span></span> with the following code and it is working now...</p><div class="source-code snippet"><div class="inner"><pre>      <a href="http://www.allegro.cc/manual/ALLEGRO_FILE"><span class="a">ALLEGRO_FILE</span></a> <span class="k3">*</span>file <span class="k3">=</span> NULL<span class="k2">;</span>
      file <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a><span class="k2">(</span>levelname, <span class="s">"rb"</span><span class="k2">)</span><span class="k2">;</span>
      <span class="k1">if</span><span class="k2">(</span>file<span class="k2">)</span> <span class="k2">{</span>
         levelcount<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
         <a href="http://www.allegro.cc/manual/al_fclose"><span class="a">al_fclose</span></a><span class="k2">(</span>file<span class="k2">)</span><span class="k2">;</span>
      <span class="k2">}</span>
</pre></div></div><p>

...which ironically, was the way I was originally going to do it until I made the mistake of discovering <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span><span class="k2">)</span></span> <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Thu, 05 Sep 2013 09:05:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>To be honest, <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a></span> should work. I suspect you weren&#39;t building the path right.</p><p>Next time you want to play with paths, <span class="source-code">ALLEGRO_PATH</span> might be a good way to go.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 05 Sep 2013 09:19:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/613220/989626#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>To be honest, al_filename_exists should work. I suspect you weren&#39;t building the path right.</p></div></div><p>

I used the same path for <span class="source-code"><a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a><span class="k2">(</span><span class="k2">)</span></span> that I used for <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span><span class="k2">)</span></span>, I only changed the code that opens it.</p><p>The old code is above, here&#39;s the new code with changes:
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>   <span class="k1">char</span> path<span class="k2">[</span>TEXT_BUFFER<span class="k2">]</span><span class="k2">;</span>
<span class="number">  2</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_732.html" target="_blank">snprintf</a><span class="k2">(</span>path, TEXT_BUFFER, <span class="s">"%s"</span>, <a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_RESOURCES_PATH<span class="k2">)</span>,
<span class="number">  3</span>                                                  ALLEGRO_NATIVE_PATH_SEP<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  4</span>
<span class="number">  5</span>   <span class="k1">int</span> levelcount <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
<span class="number">  6</span>   <span class="k1">while</span><span class="k2">(</span><span class="n">1</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number">  7</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_732.html" target="_blank">snprintf</a><span class="k2">(</span>levelname, TEXT_BUFFER, <span class="s">"level%03d.dp2"</span>, levelcount<span class="k3">+</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span>      <a href="http://www.allegro.cc/manual/ALLEGRO_FILE"><span class="a">ALLEGRO_FILE</span></a> <span class="k3">*</span>file <span class="k3">=</span> NULL<span class="k2">;</span>
<span class="number">  9</span>      file <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a><span class="k2">(</span>levelname, <span class="s">"rb"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>      <span class="k1">if</span><span class="k2">(</span>file<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 11</span>         levelcount<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
<span class="number"> 12</span>         <a href="http://www.allegro.cc/manual/al_fclose"><span class="a">al_fclose</span></a><span class="k2">(</span>file<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>      <span class="k2">}</span>
<span class="number"> 14</span>      <span class="k1">else</span> <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 15</span>   <span class="k2">}</span>
<span class="number"> 16</span>
<span class="number"> 17</span>   <a href="http://www.allegro.cc/manual/al_set_standard_file_interface"><span class="a">al_set_standard_file_interface</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 18</span>   <span class="k1">while</span><span class="k2">(</span><span class="n">1</span><span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 19</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_732.html" target="_blank">snprintf</a><span class="k2">(</span>levelname, TEXT_BUFFER, <span class="s">"level%03d.dp2"</span>, levelcount<span class="k3">+</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 20</span>      <a href="http://www.allegro.cc/manual/ALLEGRO_FILE"><span class="a">ALLEGRO_FILE</span></a> <span class="k3">*</span>file <span class="k3">=</span> NULL<span class="k2">;</span>
<span class="number"> 21</span>      file <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a><span class="k2">(</span>levelname, <span class="s">"rb"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span>      <span class="k1">if</span><span class="k2">(</span>file<span class="k2">)</span> <span class="k2">{</span>
<span class="number"> 23</span>         levelcount<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
<span class="number"> 24</span>         <a href="http://www.allegro.cc/manual/al_fclose"><span class="a">al_fclose</span></a><span class="k2">(</span>file<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 25</span>      <span class="k2">}</span>
<span class="number"> 26</span>      <span class="k1">else</span> <span class="k1">break</span><span class="k2">;</span>
<span class="number"> 27</span>   <span class="k2">}</span>
<span class="number"> 28</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Levels found: %d\n"</span>, levelcount<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 29</span>   <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 class="k2">;</span>
</div></div><p>

One thing I changed with regard to the path was I used <span class="source-code">levelname</span> which was a variable I already had created so I didn&#39;t need a <span class="source-code">filename</span> variable, but that didn&#39;t effect anything, and I tried the code with it and <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span><span class="k2">)</span></span> and still no go.  The path is built the same way, I thought of that too.  I built it several different ways, which is why I needed to know how to get the directory path that the executable was in (in another thread) and that didn&#39;t help either. Speaking of which, I just realized that code is still in there and no longer needed.  It wasn&#39;t until I changed it to <span class="source-code"><a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a><span class="k2">(</span><span class="k2">)</span></span> (originally tried <span class="source-code"><a href="http://www.delorie.com/djgpp/doc/libc/libc_337.html" target="_blank">fopen</a><span class="k2">(</span><span class="k2">)</span></span> and that worked, then the Allegro versions).  So there seems to be some sort of bug with <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span><span class="k2">)</span></span>.  There&#39;s absolutely nothing I done wrong, it&#39;s not a complicated task, my game builds the file name and loads the levels all the time, they have for over a year now, it&#39;s a straight forward task.  I have a level editor that I worked on long before this and of course I have worked with C programming and files since the 1990s.  I have trouble the odd time with Allegro 5, but not with C and files. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>One bonus to all this, the new C standard C2011, adds a new standard subspecifier (&quot;x&quot;), that can be appended to any &quot;w&quot; specifier (to form &quot;wx&quot;, &quot;wbx&quot;, &quot;w+x&quot; or &quot;w+bx&quot;/&quot;wb+x&quot;). This subspecifier forces the function to fail if the file exists, instead of overwriting it.  Could be handy, I may update my level editor to use it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Thu, 05 Sep 2013 10:50:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t suppose you could print out the actual filenames you&#39;re trying to <span class="source-code"><a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a></span>, and <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a></span>? I half expect you&#39;re missing a slash in the latter, or some similar issue.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 05 Sep 2013 11:35:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>In both cases I initially just used &quot;level011.dp2&quot; as my filename, no path, which works fine with <span class="source-code"><a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a></span> but not with <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a></span>.  I added in a path later on in an effort to get it to work but it wouldn&#39;t.  <span class="source-code"><a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a></span> has zero problems opening the level files and reading in all the data. </p><p>Strange anyhow.  Would look more elegant with just <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a></span> but it&#39;s not vitally important for me.  If it is a problem with the library it should be looked into though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Fri, 06 Sep 2013 00:02:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>it&#39;s probably a bug then...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Fri, 06 Sep 2013 00:13:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Okay, this is strange... but I just went back on a whim, to rewrite the code again and clean it up and I decided to try out <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a></span> again.  And it worked.  Which is really strange as the filename hasn&#39;t changed at all.  I am totally stumped as to why this would work now, and not last night.</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>   <span class="k1">int</span> levelcount <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
<span class="number">  2</span>   <span class="k1">bool</span> file_found<span class="k2">;</span>
<span class="number">  3</span>   <span class="k1">do</span> <span class="k2">{</span>
<span class="number">  4</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_732.html" target="_blank">snprintf</a><span class="k2">(</span>levelname, TEXT_BUFFER, <span class="s">"level%03d.dp2"</span>, levelcount<span class="k3">+</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  5</span>      file_found <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span>levelname<span class="k2">)</span><span class="k2">;</span>
<span class="number">  6</span>      <span class="k1">if</span><span class="k2">(</span>file_found<span class="k2">)</span> levelcount<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
<span class="number">  7</span>   <span class="k2">}</span> <span class="k1">while</span><span class="k2">(</span>file_found<span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span>
<span class="number">  9</span>   <a href="http://www.allegro.cc/manual/al_set_standard_file_interface"><span class="a">al_set_standard_file_interface</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>   <span class="k1">do</span> <span class="k2">{</span>
<span class="number"> 11</span>      <a href="http://www.delorie.com/djgpp/doc/libc/libc_732.html" target="_blank">snprintf</a><span class="k2">(</span>levelname, TEXT_BUFFER, <span class="s">"level%03d.dp2"</span>, levelcount<span class="k3">+</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span>      file_found <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a><span class="k2">(</span>levelname<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>      <span class="k1">if</span><span class="k2">(</span>file_found<span class="k2">)</span> levelcount<span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
<span class="number"> 14</span>   <span class="k2">}</span> <span class="k1">while</span><span class="k2">(</span>file_found<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>   <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 class="k2">;</span>
<span class="number"> 16</span>
<span class="number"> 17</span>   <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"Levels found: %d\n"</span>, levelcount<span class="k2">)</span><span class="k2">;</span>
</div></div><p>

I don&#39;t know, must have been something I done I guess, but I can&#39;t see what.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Fri, 06 Sep 2013 01:14:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Maybe last night you were running your application from the wrong working directory?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Winfield)</author>
		<pubDate>Mon, 09 Sep 2013 22:22:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The main difference I see is that you were prepending the path variable to the levelname. If levelname is missing a trailing slash on path, it&#39;d fail to find the file.</p><p>Which by the way, is why I wanted you to print out (and post) the paths it was trying to test.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 10 Sep 2013 00:45:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/613220/989860#target">Winfield</a> said:</div><div class="quote"><p>
Maybe last night you were running your application from the wrong working directory?
</p></div></div><p>

I always run it in  the same directory.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/613220/989866#target">Thomas Fjellstrom</a> said:</div><div class="quote"><p>
The main difference I see is that you were prepending the path variable to the levelname. If levelname is missing a trailing slash on path, it&#39;d fail to find the file.Which by the way, is why I wanted you to print out (and post) the paths it was trying to test.
</p></div></div><p>

This was not the problem as I used <span class="source-code"><a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a></span> to show me the path+filename it was searching for in the console window.  Plus it also happened when I didn&#39;t use a path at all (which is what it does now), the reason why I added the path in there in the first place was because it wasn&#39;t working.  Just one of many attempts to get it working.  Strange problem.</p><p>I thought for a while it could have been because I had temporarily renamed the file to &quot;level001.dp2&quot; in order to test if the game would load it in rather than the default from the zip file, and the game loaded it no problem so it could see it in the directory with the game.  I renamed it back to what it was then just tried <span class="source-code"><a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a></span> and it worked.  When I switched back to try <span class="source-code"><a href="http://www.allegro.cc/manual/al_filename_exists"><span class="a">al_filename_exists</span></a></span> one last time (because I am stubborn like that, <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=";D" border="0" />) it suddenly was working. <b>shrug</b> <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Thu, 12 Sep 2013 01:16:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, I suspect typo now <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 12 Sep 2013 01:54:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Ok, I suspect typo now <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p></div></div><p>

You&#39;re probably right.  It was late.  But I honestly went over it quite a few times and didn&#39;t see any.  I DID play around with other functions which I suspect may have effected it somewhat.  I know I used the wrong functions a few times while trying to figure it out.  Ah well, it works now. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Love Allegro 5 for the most part (though I still don&#39;t like how the audio is implemented, but that&#39;s another subject).</p><p>Anyhow, I should probably close this topic. <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Roy)</author>
		<pubDate>Sat, 14 Sep 2013 20:22:43 +0000</pubDate>
	</item>
</rss>
