<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wikiti.brandonw.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wikiti.brandonw.net/index.php?action=history&amp;feed=atom&amp;title=83Plus%3ASoftware%3Ausb8x%2FAsm_Interface%2FMSD%2FDOS_getNextFile</id>
		<title>83Plus:Software:usb8x/Asm Interface/MSD/DOS getNextFile - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wikiti.brandonw.net/index.php?action=history&amp;feed=atom&amp;title=83Plus%3ASoftware%3Ausb8x%2FAsm_Interface%2FMSD%2FDOS_getNextFile"/>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Software:usb8x/Asm_Interface/MSD/DOS_getNextFile&amp;action=history"/>
		<updated>2026-04-06T14:47:48Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Software:usb8x/Asm_Interface/MSD/DOS_getNextFile&amp;diff=5082&amp;oldid=prev</id>
		<title>Brandonw at 18:59, 17 August 2006</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Software:usb8x/Asm_Interface/MSD/DOS_getNextFile&amp;diff=5082&amp;oldid=prev"/>
				<updated>2006-08-17T18:59:34Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 18:59, 17 August 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Example code to list all files/folders in the &amp;quot;test&amp;quot; directory, which is in the root directory:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Example code to list all files/folders in the &amp;quot;test&amp;quot; directory, which is in the root directory:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; dir_cluster equ statVars ;2 bytes, starting cluster of directory&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; dir_cluster equ statVars &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;;2 bytes, starting cluster of directory&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; file_name equ statVars+2 ;13 bytes, ASCIIZ filename&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; file_name &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;equ statVars+2 ;13 bytes, ASCIIZ filename&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ...&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ld hl,0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ld hl,0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brandonw</name></author>	</entry>

	<entry>
		<id>https://wikiti.brandonw.net/index.php?title=83Plus:Software:usb8x/Asm_Interface/MSD/DOS_getNextFile&amp;diff=5081&amp;oldid=prev</id>
		<title>Brandonw at 18:58, 17 August 2006</title>
		<link rel="alternate" type="text/html" href="https://wikiti.brandonw.net/index.php?title=83Plus:Software:usb8x/Asm_Interface/MSD/DOS_getNextFile&amp;diff=5081&amp;oldid=prev"/>
				<updated>2006-08-17T18:58:34Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Synopsis ==&lt;br /&gt;
'''Name:''' DOS_getNextFile&lt;br /&gt;
&lt;br /&gt;
'''Minimum usb8x version:''' 0.10&lt;br /&gt;
&lt;br /&gt;
Gets first/next file/folder in specified directory.&lt;br /&gt;
&lt;br /&gt;
=== Inputs ===&lt;br /&gt;
* HL is the starting cluster of the directory (obtained with [[../FAT_getStartingCluster|FAT_getStartingCluster]])&lt;br /&gt;
* BC is the current entry number of a file (pass -1 on first call to this function to get the first file)&lt;br /&gt;
&lt;br /&gt;
=== Outputs ===&lt;br /&gt;
* HL points to the directory entry of the next file&lt;br /&gt;
* BC is the entry number of the next file&lt;br /&gt;
* C set if no more files are found&lt;br /&gt;
&lt;br /&gt;
=== Destroys ===&lt;br /&gt;
* AF, BC, DE, HL&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
If you want to list files/folders in a specified directory, such as for a file explorer interface, this is the function you want to use.&lt;br /&gt;
Example code to list all files/folders in the &amp;quot;test&amp;quot; directory, which is in the root directory:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 dir_cluster equ statVars ;2 bytes, starting cluster of directory&lt;br /&gt;
 file_name equ statVars+2 ;13 bytes, ASCIIZ filename&lt;br /&gt;
 ...&lt;br /&gt;
 ld hl,0&lt;br /&gt;
 ld (curRow),hl&lt;br /&gt;
 ld hl,sDirectory&lt;br /&gt;
 U_CALL FAT_getStartingCluster&lt;br /&gt;
 ld (dir_cluster),hl&lt;br /&gt;
 ld bc,-1&lt;br /&gt;
 listLoop:&lt;br /&gt;
 ld hl,(dir_cluster)&lt;br /&gt;
 U_CALL DOS_getNextFile&lt;br /&gt;
 jr c,listDone&lt;br /&gt;
 ld de,file_name&lt;br /&gt;
 push bc&lt;br /&gt;
 U_CALL FAT_nameConvertFrom11&lt;br /&gt;
 B_CALL PutS&lt;br /&gt;
 B_CALL NewLine&lt;br /&gt;
 pop bc&lt;br /&gt;
 jr listLoop&lt;br /&gt;
 listDone:&lt;br /&gt;
 ...&lt;br /&gt;
 sDirectory: DB &amp;quot;/test&amp;quot;,0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
If you are writing an application, you must copy the strings you use to RAM first, or else usb8x will not be able to see them.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[../FAT_getStartingCluster|FAT_getStartingCluster]] - Get starting cluster of specified directory&lt;/div&gt;</summary>
		<author><name>Brandonw</name></author>	</entry>

	</feed>