<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Location of Saved Files</title>
		<link>http://www.allegro.cc/forums/view/588717</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 28 Nov 2006 08:01:01 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A quick question...</p><p>I am trying to control where the user saves a file. For example, the user creates a bitmap and wants to save this bitmap. </p><p>I want the bitmap to be saved under the folder the program is run from under a folder called &quot;Bitmaps&quot;</p><p>Currently, I am only using save_bitmap();</p><p>I am thinking file_select_ex() may be what I need? But is there another way?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Fri, 24 Nov 2006 12:48:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Usually, if you do not provide a path option for them, such as <b>file_select_ex</b>, then the user is forced to accept your path selections.</p><p>1) Prompt them for the &quot;save to:&quot; filename (not path)<br />2) Allow all characters as input except those that could be perceived as a &quot;change path&quot; character (/ or \\, etc.)<br />3) When they&#39;re done typing, you can do some extra stripping of the characters and ensure that the page that you specify, like SAVE_DIR, is the same that you will be saving the resulting BITMAP (or filename, or whatever) into.  If it is, save as normal.  Otherwise, strip off all &quot;extra&quot; characters.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TeamTerradactyl)</author>
		<pubDate>Fri, 24 Nov 2006 12:57:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="k1">char</span><span class="k3">*</span> Savefilename<span class="k2">;</span>
Savefilename <span class="k3">=</span> <span class="s">"Bitmaps/hethisismyfirstbitmap.bmp"</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/save_bitmap" target="_blank"><span class="a">save_bitmap</span></a><span class="k2">(</span>Savefilename, ...<span class="k2">)</span>
</pre></div></div><p>
Just include the relative path in the filename section in save_bitmap(), that will store it in any directory you want.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Dalrymple)</author>
		<pubDate>Sat, 25 Nov 2006 10:17:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
char* Savefilename;<br />Savefilename = &quot;Bitmaps/hethisismyfirstbitmap.bmp&quot;;<br />save_bitmap(Savefilename, ...)
</p></div></div><p>

for some reason, it didn&#39;t create the BITMAP folder, I searched for it and could not find it... this is what i used
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">char</span> <span class="k3">*</span>path<span class="k2">;</span>
<span class="c">/*allegro has been init and all that good stuff</span>
<span class="c">and user picks Yes to save file*/</span>
path <span class="k3">=</span> <span class="s">"Bitmaps\\testbmp.bmp"</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/save_bitmap" target="_blank"><span class="a">save_bitmap</span></a><span class="k2">(</span>path, myBMP, pal<span class="k2">)</span><span class="k2">;</span>
<span class="c">/*exiting allegro, etc*/</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Mon, 27 Nov 2006 07:05:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
for some reason, it didn&#39;t create the BITMAP folder
</p></div></div><p>

You will have to do this yourself. If you&#39;re using gcc, there is the <tt>mkdir()</tt> function for creating directories.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 27 Nov 2006 10:03:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks! I&#39;ve finally figured it out!</p><p>Thanks to all your help!!;D
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (inspiredevistate)</author>
		<pubDate>Mon, 27 Nov 2006 11:08:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You may also want to use &#39;/&#39; instead of &#39;\\&#39; for path separators: Windows will automatically convert these to the double-backslashes for you, and this makes it more cross-compatible with Linux/Mac.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TeamTerradactyl)</author>
		<pubDate>Tue, 28 Nov 2006 08:01:01 +0000</pubDate>
	</item>
</rss>
