-
Notifications
You must be signed in to change notification settings - Fork 78
SIO Command $F6 Read Directory
Oscar Fowler edited this page Jul 25, 2020
·
6 revisions
Retrieve the next directory entry text and place into buffer. AUX1 can be used to specify a maximum length to retrieve, which is subsequently truncated by the ESP. This is useful for making read commands more efficient for display, and using a subsequent Directory Open/Directory Read to get the full 256 character filename for mounting.
AUX2 meanwhile, contains the requested host slot in which to read the directory entry, this is required because file descriptor numbers are not guaranteed to be mutually exclusive.
| DCB | Value |
|---|---|
| DDEVIC | $70 |
| DUNIT | $01 |
| DCOMND | $F6 |
| DSTATS | $40 |
| DBUF | Buffer to contain the directory entry 0-255 bytes |
| DTIMLO | # of seconds before timeout |
| DBYT | # of bytes to return in directory entry |
| DAUX1 | entry offset 0 being first entry |
| DAUX2 | requested host slot |
NUL terminated string with directory entry. or first byte contains 0x7F if no more entries.
/**
A directory entry, with stat() information
*/
union
{
struct
{
unsigned short mode;
unsigned long size;
char filename[256];
} entry;
unsigned char rawData[262]; // max size.
} dirEntry;
// loop and read dir for display
while ((dirEntry.entry.filename[0]!=0x7F))
{
memset(dirEntry.rawData,0,sizeof(dirEntry.rawData);
dirEntry.entry.filename[0]=0x7F;
OS.dcb.ddevic=0x70;
OS.dcb.dunit=1;
OS.dcb.dcomnd=0xF6;
OS.dcb.dstats=0x40;
OS.dcb.dbuf=&path;
OS.dcb.dtimlo=0x0F;
OS.dcb.dbyt=36;
OS.dcb.daux1=offset;
OS.dcb.daux2=hostSlot;
siov();
if (dirEntry.entry.filename[0]=='.')
continue;
else if (dirEntry.entry.filename[0]==0x7F)
break;
else
{
strcpy(files[num_entries],path);
screen_puts(0,num_entries+2,path);
num_entries++;
}
}
- Open Directory
- Close Directory
Copyright 2024 Contributors to the FujiNetWIFI project.
Join us on Discord: https://discord.gg/7MfFTvD
- Home
- What is FujiNet?
- The Definition of Done
- Board bring up for FujiNet Platform.IO code
- The Complete Linux CLI Guide
- The Complete macOS CLI Guide
- Development Env for Apps
- FujiNet-Development-Guidelines
- System Quickstarts
- FujiNet Flasher
- Setting up a TNFS Server
- FujiNet Configuration File: fnconfig.ini
- AppKey Registry - SIO Command $DC Open App Key
- CP-M Support
- BBS
- Official Hardware Versions
- Prototype Board Revisions
- FujiNet Development Guidelines
- Atari Programming
- Apple Programming
- C64 Programming
- ADAM Programming
- Testing Plan
- Hacker List
- FujiNet VirtualMachine