<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>[Resolved] Retrieve filelist</title>
<description> Hello !

I have an Error with filelist retrieve.

When I lauch my homebrew, I have got this error: [-] File List Error (ret = -1)

/* Retrieve filelist */
ret = filelist_retrieve();
if (ret &amp;lt; 0) 
{
printf(&quot;\n[-] File List Error (ret = %d)\n&quot;, ret);
goto err;
}

Here is the function:

s32 filelist_retrieve(void)
{
char dirpath[MAX_FILEPATH_LEN];
char *ptr = filelist;

struct stat filestat;
DIR_ITER *dir;

/* Generate dirpath */
sprintf(dirpath, &quot;fat%d:/&quot; FILE_DIRECTORY, device);

/* Open directory */
dir = diropen(&quot;Rider&quot;);
if (!dir)
return -1;

/* Reset file counter */
nb_files = 0;

/* Erase file list */
memset(filelist, 0, sizeof(filelist));

/* Get directory entries */
while (!dirnext(dir, ptr, &amp;filestat))
if (!(filestat.st_mode &amp; S_IFDIR)) 
{
ptr += strlen(ptr) + 1;
nb_files++;
}

/* Close directory */
dirclose(dir);

return 0;
}

But I don&amp;#039;t understand what&amp;#039;s wrong... My libogc is updated.

The homebrew could open the FILE_DIRECTORY.

Thanks for the help</description><link>http://forum.wiibrew.org/read.php?11,65513,65513#msg-65513</link><lastBuildDate>Sun, 15 Nov 2026 21:23:16 +0000</lastBuildDate>
<generator>Phorum 6.0.6</generator>
<item>
<guid>http://forum.wiibrew.org/read.php?11,65513,65522#msg-65522</guid>
<title>Re: Retrieve filelist</title><link>http://forum.wiibrew.org/read.php?11,65513,65522#msg-65522</link><description><![CDATA[ Thanks for helping me.<br /><br />I have the same problem with:<br /><br /><pre class="bbcode">
	/* Generate dirpath */
	sprintf(dirpath, "fat%d:/" FILE_DIRECTORY, device);
	
	/* Open directory */
	dir = diropen(dirpath);
	if (!dir)
		return -1;</pre><br />Same error with this:<br /><pre class="bbcode">
	/* Generate dirpath */
	sprintf(dirpath, "/" FILE_DIRECTORY);
	
	/* Open directory */
	dir = diropen("rider");
	if (!dir)
		return -1;</pre><br /><br />And it works fine with this:<br /><pre class="bbcode">
	/* Generate dirpath */
	sprintf(dirpath, "/" FILE_DIRECTORY);
	
	/* Open directory */
	dir = diropen(dirpath);
	if (!dir)
		return -1;</pre><br /><br />Thank you very much for the help man !!!]]></description>
<dc:creator>RiderFx3</dc:creator>
<category>Coding</category><pubDate>Wed, 30 Mar 2011 19:41:17 +0000</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,65513,65516#msg-65516</guid>
<title>Re: Retrieve filelist</title><link>http://forum.wiibrew.org/read.php?11,65513,65516#msg-65516</link><description><![CDATA[ Wait a sec, you don&#039;t even use the dirpath... also change dir = diropen("Rider"); to dir = diropen(dirpath); then.]]></description>
<dc:creator>Daid</dc:creator>
<category>Coding</category><pubDate>Wed, 30 Mar 2011 14:20:55 +0000</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,65513,65515#msg-65515</guid>
<title>Re: Retrieve filelist</title><link>http://forum.wiibrew.org/read.php?11,65513,65515#msg-65515</link><description><![CDATA[ Thanks for the help !<br /><br />it&#039;s on the SD<br /><br />i will try tonight!]]></description>
<dc:creator>RiderFx3</dc:creator>
<category>Coding</category><pubDate>Wed, 30 Mar 2011 12:56:21 +0000</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,65513,65514#msg-65514</guid>
<title>Re: Retrieve filelist</title><link>http://forum.wiibrew.org/read.php?11,65513,65514#msg-65514</link><description><![CDATA[ Is your homebrew on USB or SD?<br /><br />Try sprintf(dirpath, "/" FILE_DIRECTORY);<br /><br />It defaults to the &#039;default&#039; device if you don&#039;t give in any device.]]></description>
<dc:creator>Daid</dc:creator>
<category>Coding</category><pubDate>Wed, 30 Mar 2011 12:46:46 +0000</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,65513,65513#msg-65513</guid>
<title>[Resolved] Retrieve filelist</title><link>http://forum.wiibrew.org/read.php?11,65513,65513#msg-65513</link><description><![CDATA[ Hello !<br /><br />I have an Error with filelist retrieve.<br /><br />When I lauch my homebrew, I have got this error: <b>[-] File List Error (ret = -1)</b><br /><pre class="bbcode">
	/* Retrieve filelist */
	ret = filelist_retrieve();
	if (ret &lt; 0) 
	{
		printf("\n[-] File List Error (ret = %d)\n", ret);
		goto err;
	}</pre><br />Here is the function:<br /><pre class="bbcode">
s32 filelist_retrieve(void)
{
	char dirpath[MAX_FILEPATH_LEN];
	char *ptr = filelist;
	
	struct stat filestat;
	DIR_ITER *dir;
	
	/* Generate dirpath */
	sprintf(dirpath, "fat%d:/" FILE_DIRECTORY, device);
	
	/* Open directory */
	dir = diropen("Rider");
	if (!dir)
		return -1;
	
	/* Reset file counter */
	nb_files = 0;
	
	/* Erase file list */
	memset(filelist, 0, sizeof(filelist));
	
	/* Get directory entries */
	while (!dirnext(dir, ptr, &filestat))
		if (!(filestat.st_mode & S_IFDIR)) 
		{
			ptr += strlen(ptr) + 1;
			nb_files++;
		}
	
	/* Close directory */
	dirclose(dir);
	
	return 0;
}</pre><br />But I don&#039;t understand what&#039;s wrong... My libogc is updated.<br /><br />The homebrew could open the FILE_DIRECTORY.<br /><br />Thanks for the help]]></description>
<dc:creator>RiderFx3</dc:creator>
<category>Coding</category><pubDate>Wed, 30 Mar 2011 10:35:47 +0000</pubDate></item>
</channel>
</rss>