int ok = Stat(STRPTR name, ULONG flags, struct hwos_StatStruct *st, struct hwTagList *tags);
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 Stat()
implementation needs to write the following information
to the individual structure members:
Type:
HWSTATTYPE_FILE:
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 Stat()
. 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 Stat()
. If HWSTATFLAGS_ALLOCSTRINGS
has been set, you need to
allocate a string buffer using hw_TrackedAlloc().
LinkMode:
Container:
NULL
.
The following flags are supported by Stat()
:
HWSTATFLAGS_ALLOCSTRINGS:
Stat()
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 Stat()
is used in a multithreaded
setup.
Stat()
has to return True
on success or False
on failure.
Stat()
is often used by Hollywood to find out whether a certain file system object
is a file or a directory. It is also used to resolve relative file name specifications
into absolute, fully-qualified paths. So make sure your implementation provides this
information in the FullPath
structure member above.
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 file system objectNULL
)True
to indicate success, False
on failure