<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>getting in a string content of a folder</title>
		<link>http://www.allegro.cc/forums/view/590518</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 13 Mar 2007 15:50:55 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>hello, is there any elegant way to get the equivalent of <span class="source-code"> <a href="http://www.delorie.com/djgpp/doc/libc/libc_802.html" target="_blank">system</a><span class="k2">(</span><span class="s">"dir *./b/w &gt; list_of_shows.txt "</span><span class="k2">)</span></span> then get the text inside of a string ? <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /></p><p>using external command of system ( winXP) I m enclenching and flashing a dos window... <br />I was thinking to do something like tree&gt;my_string, but commands like dir or tree seems not existing in gcc <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /></p><p>thanks for the answer !!! <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (karistouf)</author>
		<pubDate>Tue, 13 Mar 2007 03:13:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you&#39;re using Allegro, you might consider using <a href="http://www.allegro.cc/manual/api/file-and-compression-routines/al_findfirst">these functions</a>.</p><p>[EDIT]<br />Heh, you are lazy ... you didn&#39;t even search for your problem! <a href="http://www.allegro.cc/forums/thread/590511">This was the thread below your one ...</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michael Faerber)</author>
		<pubDate>Tue, 13 Mar 2007 03:16:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This is not elegant nor equivalent, but might be enough.</p><div class="source-code snippet"><div class="inner"><pre>FILE <span class="k3">*</span>f <span class="k3">=</span> NULL<span class="k2">;</span>
<span class="k1">char</span> <a href="http://www.allegro.cc/manual/line" target="_blank"><span class="a">line</span></a><span class="k2">[</span><span class="n">256</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">""</span><span class="k2">;</span>
<span class="k1">char</span> dir_result<span class="k2">[</span><span class="n">4096</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">""</span><span class="k2">;</span>
<a href="http://www.delorie.com/djgpp/doc/libc/libc_802.html" target="_blank">system</a><span class="k2">(</span><span class="s">"dir c:\\my_path\\ &gt; c:\\file.txt"</span><span class="k2">)</span><span class="k2">;</span>
f <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_337.html" target="_blank">fopen</a> <span class="k2">(</span><span class="s">"C:\\file.txt"</span>, <span class="s">"r"</span><span class="k2">)</span><span class="k2">;</span>
<span class="k1">while</span> <span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_320.html" target="_blank">fgets</a><span class="k2">(</span><a href="http://www.allegro.cc/manual/line" target="_blank"><span class="a">line</span></a>, <span class="n">256</span>, f<span class="k2">)</span> <span class="k3">!</span><span class="k3">=</span> NULL<span class="k2">)</span> <span class="k2">{</span>
  <a href="http://www.delorie.com/djgpp/doc/libc/libc_752.html" target="_blank">strcat</a><span class="k2">(</span>dir_result, <a href="http://www.allegro.cc/manual/line" target="_blank"><span class="a">line</span></a><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
<a href="http://www.delorie.com/djgpp/doc/libc/libc_308.html" target="_blank">fclose</a><span class="k2">(</span>f<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
printf(dir_result);
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Rampage)</author>
		<pubDate>Tue, 13 Mar 2007 03:18:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>yes, I m under allegro ( so i m not using system command because they flash shortly the ms dos screen on my app). <br />in fact, is there any key word for just having list of folder types inside a folder ?</p><p>( thanks for your answer!);D
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (karistouf)</author>
		<pubDate>Tue, 13 Mar 2007 03:19:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
is there any key word for just having list of folder types inside a folder
</p></div></div><p>

FA_DIREC?</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_findfirst" target="_blank"><span class="a">al_findfirst</span></a><span class="k2">(</span><span class="s">"*"</span>, <span class="k3">&amp;</span>info, FA_DIREC<span class="k2">)</span><span class="k2">;</span></span></p><p>Were you asking how to just see the folders?  Above + al_findnext gives you the directories.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Dalrymple)</author>
		<pubDate>Tue, 13 Mar 2007 04:05:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can someone explain why such a thing is not part of standard c++ (though most cross-platform libraries end up including such functionality). This is a really common task.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Goalie Ca)</author>
		<pubDate>Tue, 13 Mar 2007 04:43:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Can someone explain why such a thing is not part of standard c++ (though most cross-platform libraries end up including such functionality). This is a really common task.
</p></div></div><p>Sure: It&#39;s a command task on PCs, but that&#39;s not what C++ was designed for.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Tue, 13 Mar 2007 05:06:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was thinking about the scope of C++ and its embedded stuff (Since i deal with that too) and embedded systems actually deal a lot with files as well. It&#39;s really just one of those things that has some obscure bs reason or it could be as simple as no one has bothered yet.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Goalie Ca)</author>
		<pubDate>Tue, 13 Mar 2007 11:22:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>thanks to evey body for the answer, always a pleasure!!!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (karistouf)</author>
		<pubDate>Tue, 13 Mar 2007 12:27:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Can someone explain why such a thing is not part of standard c++
</p></div></div><p>This is a common part of C and C is part of C++ so you have this functionality readily availiable in C++ too.<br /><a href="http://www.gnu.org/software/libc/manual/html_node/File-System-Interface.html#File-System-Interface">http://www.gnu.org/software/libc/manual/html_node/File-System-Interface.html#File-System-Interface</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (HoHo)</author>
		<pubDate>Tue, 13 Mar 2007 13:22:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
embedded systems actually deal a lot with files as well.
</p></div></div><p>Some do, but even in those it&#39;s not uncommon to have a radically different file system than the PC one, which makes it impossible to design a unified interface to.</p><p>Of course, it occurs to me know that I&#39;m confusing C++ and the standard library. Sooo, I suppose a better reason is simply that Microsoft didn&#39;t think it was worthwhile to implement the functions in HoHo&#39;s link.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Tue, 13 Mar 2007 15:50:55 +0000</pubDate>
	</item>
</rss>
