Name
hw_NextDirEntry -- return next directory object (V5.0)
Synopsis
int ok = hw_NextDirEntry(APTR handle, APTR dirhandle, struct
               hwos_ExLockStruct *exlock);
Function
This function reads the next file system object from the specified directory handle. This handle must have been opened by hw_Lock(). You also have to pass the handle returned to you by hw_BeginDirScan(). If hw_NextDirEntry() returns False, then all entries have been read. If it returns True, then you can read information about the file system object from the struct hwos_ExLockStruct which has to be passed in parameter 2. struct hwos_ExLockStruct looks like this:

 
struct hwos_ExLockStruct
{
    int nStructSize;   // [in]
    STRPTR Name;       // [out]
    int Type;          // [out]
    ULONG Size;        // [out]
    ULONG Flags;       // [out]
};

Here's a description of the individual structure members:

nStructSize:
This must be set by you to sizeof(struct hwos_ExLockStruct) before calling hw_NextDirEntry().

Name:
This contains the name of the file system object without any path specification. This pointer will be valid until the next call to hw_NextDirEntry().

Type:
This will be set to one of the following types:

HWEXLOCKTYPE_FILE:
The file system object is a file.

HWEXLOCKTYPE_DIRECTORY:
The file system object is a directory.

Size:
Size of object in bytes if it is a file, otherwise 0.

Flags:
Combination of flags describing the file system object attributes. See File attributes for a list of supported attributes.

Designer compatibility
Supported since Designer 4.0

Inputs
handle
handle returned by hw_Lock()
dirhandle
handle returned by hw_BeginDirScan()
exlock
pointer to a struct hwos_ExLockStruct for storing information about the file system object
Results
ok
True if an object could be read, False if there are no more objects

Show TOC