•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
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-FileDclosedir()
Dreaddir()
Drewinddir()
Dopendir()                                                           GEMDOS

Syntax

LONG Dopendir( name, flag )
char *name;
WORD flag;

Function      Dopendir() opens the specified directory for reading.

Opcode        296 (0x128)

Availability  Available when a 'MiNT' cookie with a version of at least
              0.90 exists.

Parameters    name is a pointer to a null-terminated directory
              specification of the directory to open. name should not be
              contain a trailing backslash. flag determines whether to
              open the file in normal or compatibility mode. A value of
              MODE_NORMAL (0) for flag signifies normal mode whereas
              a value of MODE_COMPAT (1) signifies compatibility
              mode. Compatibility mode forces directory searches to be
              performed much like Fsfirst() and Fsnext() (restricting
              filenames to the DOS 8 + 3 standard in uppercase). In normal
              mode, filenames returned by Dreaddir() will be in the
              format native to the file system and a UNIX style file index
              will be returned.

Binding       move.w   flag,-(sp)
              pea      name
              move.w   #$128,-(sp)
              trap     #1
              addq.l   #8,sp

Return Value  Dopendir() returns a LONG directory handle (which may be
              positive or negative) if successful. A negative GEMDOS error
              code will be returned if the call fails.

Caveats       Failure to properly close directory handles may cause the
              system to eventually run out of handles which will cause the
              OS to fail.

Comments      Negative directory handles and negative GEMDOS error codes
              may be differentiated by checking for 0xFF in the high byte.
              Returned values with 0xFF in the high byte are errors.

See Also      Dclosedir(), Dreaddir(), Drewinddir()