Name
NextDirEntry -- return next directory object (V6.0)
Synopsis
int more = NextDirEntry(APTR handle, struct hwos_StatStruct *st,
               struct hwTagList *tags);
Function
This function has to return the next file system object from the directory handle passed in parameter 1. File system objects can be returned in a random order. They do not need to be alphabetically sorted. NextDirEntry() needs to return True if it has obtained a file system object from the directory or False if all entries have been retrieved. If it returns True, it has to write information about the file system object retrieved to the struct hwos_StatStruct pointer passed in parameter 2. struct hwos_StatStruct looks like this:

 
struct hwos_StatStruct
{
    int Type;                               // [out]
    DOSINT64 Size;                          // [out]
    ULONG Flags;                            // [out]
    struct hwos_DateStruct Time;            // [out]
    struct hwos_DateStruct LastAccessTime;  // [out]
    struct hwos_DateStruct CreationTime;    // [out]
    STRPTR FullPath;                        // [out]
    STRPTR Comment;                         // [out]
    int LinkMode;                           // [out]
    STRPTR Container;                       // [out]
};

Your NextDirEntry() implementation needs to write the following information to the individual structure members:

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

HWSTATTYPE_FILE:
The file system object is a file.

HWSTATTYPE_DIRECTORY:
The file system object is a directory.

Size:
Size of object in bytes if it is a file, 0 for directories. Note that this can also be set to -1 in case the file size isn't know, for example because the file is being streamed from a network source.

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

Time:
Time stamp indicating when this file system object was last modified. This information is optional. Do not touch this member if you don't have this time information.

LastAccessTime:
Time stamp indicating when this file system object was last accessed. This information is optional. Do not touch this member if you don't have this time information.

CreationTime:
Time stamp indicating when this file system object was created. This information is optional. Do not touch this member if you don't have this time information.

FullPath:
Name of the file system object. This must be provided. The string pointer you use here must stay valid until the next call to NextDirEntry(). Please note that in contrast to its name, FullPath must not be set to a fully qualified path but just to the name of the file system object without any path components.

Comment:
Comment stored for this object in the file system. Set this to NULL if you do not have this information or the file system doesn't support storage of comments. The string pointer you pass here must stay valid until the next call to NextDirEntry().

LinkMode:
Currently unused. Set to 0.

Container:
Currently unused. Set to NULL.

Inputs
handle
directory handle returned by OpenDir()
st
pointer to a struct hwos_StatStruct for storing information about the file system object
tags
reserved for future use (currently NULL)
Results
ok
True if file system object has been retrieved, False if there are no more objects

Show TOC