Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FileDopendir()Dclosedir()Drewinddir()Dreaddir() GEMDOSSyntaxLONG Dreaddir( len, dirhandle, buf )
WORD len;
LONG dirhandle;
char *buf;
Function Dreaddir() enumerates the contents of the specified
directory.
Opcode 297 (0x129)
Availability Available when a 'MiNT' cookie with a version of at least
0.90 exists.
Parameters Dreaddir() fetches information about the next file contained
in the directory specified by dirhandle. len specifies the
length of the buffer pointed to by buf which should be
enough to hold the size of the filename, NULL byte, and
index (if in normal mode).
Binding pea buf
move.l dirhandle
move.w len
move.w #$129,-(sp)
trap #1
lea 12(sp),sp
Return Value Dreaddir() returns a 0 if the operation was successful,
ERANGE (-64) if the buffer was not large enough to hold the
index and name, or ENMFIL (-47) if there were no more files
to read.
Comments In normal mode, Dreaddir() returns a 4-byte file index in
the first four bytes of buf. The filename then follows
starting at the fifth byte of buf. The file index is present
to prevent confusion under some file systems when two files
of the same name exist. In some file systems this is legal,
however, in all file systems, the 4-byte index will be
unique. When in compatibility mode, the filename begins at
&buf[0].
See Also Dopendir(), Dclosedir(), Drewinddir()