int ok = StatDir(APTR handle, ULONG flags, struct hwos_StatStruct *st,
struct hwTagList *tags);
HWEXT_DIRADAPTER_STAT
extension bit has been set. See Extension plugins for details. In that case, this
function has to do the same as Stat() but instead of a string describing
a path to a file system object it has to be able to obtain information about a directory from
its handle allocated by OpenDir(). StatDir() needs to write the information
about the directory to the structure pointer passed in parameter 3. 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; // [unused]
STRPTR Container; // [unused]
};
|
Your StatDir() implementation needs to write the following information
to the individual structure members:
Type:HWSTATTYPE_DIRECTORY.
Size:
Flags:
Time:
LastAccessTime:
CreationTime:
FullPath:HWSTATFLAGS_ALLOCSTRINGS flag is not set, you can set this to a static string
buffer which must stay valid until the next call to StatDir(). If HWSTATFLAGS_ALLOCSTRINGS
has been set, you need to allocate a string buffer using hw_TrackedAlloc().
Comment:NULL
if you do not have this information or the file system doesn't support
storage of comments. If the HWSTATFLAGS_ALLOCSTRINGS flag is not set, you
can set this to a static string buffer which must stay valid until the next
call to StatDir(). If HWSTATFLAGS_ALLOCSTRINGS has been set, you need to
allocate a string buffer using hw_TrackedAlloc().
The following flags are supported by StatDir():
HWSTATFLAGS_ALLOCSTRINGS:StatDir() must not use static string buffers for the FullPath
and Comment structure members but allocate new private string buffers for them.
Hollywood will then call hw_TrackedFree() on these buffers
once it is done with them. This flag is often set when StatDir() is used in a multithreaded
setup.
StatDir() has to return True on success or False on failure.
This function must be implemented in a thread-safe manner if the HWSTATFLAGS_ALLOCSTRINGS
flag is set.
struct hwos_StatStruct for storing information
about the directoryNULL)True to indicate success, False on failure