int ok = FStat(APTR handle, ULONG flags, struct hwos_StatStruct *st, struct hwTagList *tags);
FStat()
needs to write the information
about the file 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; // [out] STRPTR Container; // [out] }; |
Your FStat()
implementation needs to write the following information
to the individual structure members:
Type:
HWSTATTYPE_FILE
.
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 FStat()
. 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:
HWSTATLKMODE_NORMAL:
HWSTATLKMODE_NORMAL
, the compiled applet or executable won't require your
file adapter plugin any more. Also, your file adapter won't be called at all
when the user runs the compiled applet or executable because Hollywood
has already obtained the raw data from the file adapter during linking
stage.
HWSTATLKMODE_NONE:
HWSTATLKMODE_NONE
is the right choice since it skips linking for this
file altogether.
HWSTATLKMODE_CONTAINER:
HWSTATLKMODE_NORMAL
now, Hollywood would always link the uncompressed
data to the applet or executable. However, you might want to make
Hollywood link the compressed data instead. This can be achieved by
setting the link mode to HWSTATLKMODE_CONTAINER
and then setting the
Container
member of this structure to the file that contains the
compressed data. When setting LinkMode
to HWSTATLKMODE_CONTAINER
,
Hollywood will always link the file specified in Container
instead
of the current file. Please note that if you use HWSTATLKMODE_CONTAINER
,
your implementation of FOpen() has to support the
HWFOPENTAG_CHUNKXXX
tags and you have to set the HWCLAFAFLAGS_CHUNKLOADER
flag using hw_ConfigureLoaderAdapter().
See FOpen for details.
Container:
LinkMode
to HWSTATLKMODE_CONTAINER
, you need to set this
member to a path to a file that should be linked instead of the current file
when Hollywood is in linking mode. This can be used for fine-tuned control
over Hollywood's linker. See above for more information. The string
buffer you use to pass a container file to Hollywood must stay valid
until the next call to FStat()
. Note that HWSTATFLAGS_ALLOCSTRINGS
(see below) doesn't affect Container
. It must always use a static
string buffer. If link mode isn't set to HWSTATLKMODE_CONTAINER
, set
this member to NULL
.
The following flags are supported by FStat()
:
HWSTATFLAGS_ALLOCSTRINGS:
FStat()
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 FStat()
is used in a multithreaded
setup.
FStat()
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 fileNULL
)True
to indicate success, False
on failure