<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[A5] Questions regarding the &quot;File System Routines&quot;</title>
		<link>http://www.allegro.cc/forums/view/608812</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 15 Nov 2011 14:56:59 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><b>1. How to get file names without their paths?</b><br />The <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_fs_entry_name"><span class="a">al_get_fs_entry_name</span></a><span class="k2">(</span><span class="k2">)</span></span> return the full path+name of a file or directory, not only the name.<br />Is it possible to get only the name or do I simply have to trim the string myself? What I get is: &quot;mods\AAL2D\gfx\ingame\blood.png&quot; and what I want: &quot;blood.png&quot;.</p><p><b>2. Can I filter the result on specific file extensions?</b><br />In A4 it was possible to filter the result by entering a specific file extension into <span class="source-code"><a href="http://www.allegro.cc/manual/al_findfirst"><span class="a">al_findfirst</span></a><span class="k2">(</span><span class="k2">)</span></span>.<br />I do not see anything like that in A5 when looking in the manual and examples. Do I have to filter this myself by comparing last part of string?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TeaRDoWN)</author>
		<pubDate>Mon, 14 Nov 2011 20:30:29 +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/608812/937357#target">TeaRDoWN</a> said:</div><div class="quote"><p> 1. How to get file names without their paths?</p></div></div><p><a href="http://pubs.opengroup.org/onlinepubs/009604499/functions/basename.html">basename()</a></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> 2. Can I filter the result on specific file extensions?</p></div></div><p>If you click on your own link <a href="http://www.allegro.cc/manual/4/api/file-and-compression-routines/al_findfirst">al_findfirst()</a>, it gives an example of searching for pcx files.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Mon, 14 Nov 2011 22:32:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There is an al_get_path_basename() function, if you want something more portable than basename.  You would then have to create (and destroy) a temporary ALLEGRO_PATH.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 14 Nov 2011 22:52:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><ol><li><p>You can use the path routines. <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_path_filename"><span class="a">al_get_path_filename</span></a><span class="k2">(</span><span class="k2">)</span></span> will get the filename.</p></li><li><p>A5 does not provide a way to filter by extension.</p></li></ol><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Mon, 14 Nov 2011 22:57:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>And if you already have an ALLEGRO_PATH for the file, you can use <span class="source-code"><a href="http://www.allegro.cc/manual/al_get_path_extension"><span class="a">al_get_path_extension</span></a><span class="k2">(</span><span class="k2">)</span></span> to get the extension <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 15 Nov 2011 01:34:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Arthur: I know that you filter with <span class="source-code"><a href="http://www.allegro.cc/manual/al_findfirst"><span class="a">al_findfirst</span></a><span class="k2">(</span><span class="k2">)</span></span> but it is an A4 function and does not exist in A5 which I&#39;ve moved over to.</p><p>Ok, thank guys for the answers. I&#39;ll use the al_get_path... functions to get the name and to filter on the extension.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TeaRDoWN)</author>
		<pubDate>Tue, 15 Nov 2011 14:56:59 +0000</pubDate>
	</item>
</rss>
