<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>How to load file into ram</title>
<description> I&amp;#039;m trying get a program I&amp;#039;m creating to load a file into ram. Now I&amp;#039;m not sure if LibFat or the memcpy call does this so can someone explain to me with some example code how to load a file into ram.

also can someone tell me how much ram the wii has, I looked it up on google but everything I found says different.</description><link>http://forum.wiibrew.org/read.php?11,2520,2520#msg-2520</link><lastBuildDate>Tue, 06 Oct 2026 16:40:30 +0200</lastBuildDate>
<generator>Phorum 5.2.23</generator>
<item>
<guid>http://forum.wiibrew.org/read.php?11,2520,2607#msg-2607</guid>
<title>Re: How to load file into ram</title><link>http://forum.wiibrew.org/read.php?11,2520,2607#msg-2607</link><description><![CDATA[ lol sorry for the late reply, thanks guys :)]]></description>
<dc:creator>Matando</dc:creator>
<category>Coding</category><pubDate>Thu, 16 Oct 2008 00:25:01 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,2520,2567#msg-2567</guid>
<title>Re: How to load file into ram</title><link>http://forum.wiibrew.org/read.php?11,2520,2567#msg-2567</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>blasty</strong><br />Whodares&#039; routine will indeed happily load a file into RAM but never return a pointer or anything to the data</div></blockquote><br />lol, good call, I never even noticed that :-P<br /><br />Updated it now.]]></description>
<dc:creator>whodares</dc:creator>
<category>Coding</category><pubDate>Mon, 13 Oct 2008 09:45:20 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,2520,2562#msg-2562</guid>
<title>Re: How to load file into ram</title><link>http://forum.wiibrew.org/read.php?11,2520,2562#msg-2562</link><description><![CDATA[ Whodares&#039; routine will indeed happily load a file into RAM but never return a pointer or anything to the data. (add return myBuffer to the end of the function). Also, dont forget to free() your buffers when you&#039;re done with them.]]></description>
<dc:creator>blasty</dc:creator>
<category>Coding</category><pubDate>Mon, 13 Oct 2008 09:18:01 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,2520,2542#msg-2542</guid>
<title>Re: How to load file into ram</title><link>http://forum.wiibrew.org/read.php?11,2520,2542#msg-2542</link><description><![CDATA[ Determining file size is simple enough as long as you&#039;re not working with streams that you can&#039;t seek in (on Wii, you&#039;re almost certainly not):<br /><pre class="bbcode">int pos = ftell(File);
fseek(File, 0, SEEK_END);
size = ftell(File);
fseek(File, pos, SEEK_SET); //return to previous position</pre>]]></description>
<dc:creator>HyperHacker</dc:creator>
<category>Coding</category><pubDate>Sun, 12 Oct 2008 07:37:33 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,2520,2534#msg-2534</guid>
<title>Re: How to load file into ram</title><link>http://forum.wiibrew.org/read.php?11,2520,2534#msg-2534</link><description><![CDATA[ <pre class="bbcode">
void* loadFileContents( char* fileName, int fileLength )
{
	void* myBuffer;
	FILE* inputFile;

	inputFile = fopen( fileName, "rb");
	myBuffer = malloc(fileLength);
	fread( myBuffer, 1, fileLength, inputFile);
	fclose(inputFile);
	return myBuffer;
}</pre><br />I can&#039;t remember the code to find the file length, but something like this will dynamically read the file in. Don&#039;t forget to deallocate the space after you&#039;re finished :-)]]></description>
<dc:creator>whodares</dc:creator>
<category>Coding</category><pubDate>Sat, 11 Oct 2008 21:16:15 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,2520,2533#msg-2533</guid>
<title>Re: How to load file into ram</title><link>http://forum.wiibrew.org/read.php?11,2520,2533#msg-2533</link><description><![CDATA[ What, loading a file in ram ? You&#039;re speaking about load a file into a variable ?<br />If yes, use fread(); =)]]></description>
<dc:creator>Minishlink</dc:creator>
<category>Coding</category><pubDate>Sat, 11 Oct 2008 20:53:23 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,2520,2520#msg-2520</guid>
<title>How to load file into ram</title><link>http://forum.wiibrew.org/read.php?11,2520,2520#msg-2520</link><description><![CDATA[ I&#039;m trying get a program I&#039;m creating to load a file into ram. Now I&#039;m not sure if LibFat or the memcpy call does this so can someone explain to me with some example code how to load a file into ram.<br /><br />also can someone tell me how much ram the wii has, I looked it up on google but everything I found says different.]]></description>
<dc:creator>Matando</dc:creator>
<category>Coding</category><pubDate>Sat, 11 Oct 2008 17:13:40 +0200</pubDate></item>
</channel>
</rss>