Project: Stream Extension Classes
Unit: PJIStreams
Class: TPJFileIStream
Applies to: ~>3.0
function Stat(out statstg: TStatStg; grfStatFlag: Longint): HResult;
virtual; stdcall;Stat retrieves a STATSTG structure that provides information about the file associated with the stream.
This version of Stat modifies the method inherited from TPJHandleIStreamWrapper to provide the file name instead of a name based on class names in the pwcsName field of the TStatStg record.
Parameters:
- statstg -- Receives the required TStatStg (STATSTG) record.
- grfStatFlag -- Specifies which members of the TStatStg record are not to contain information. Possible values are:
- STATFLAG_DEFAULT: Omits the stream name from the record.
- STATFLAG_NORMAL: Includes the stream name in the record. In this case the name should be freed by the caller using the task allocator.
Returns:
- S_OK on success.
- E_UNEXPECTED if an exception occurs
- STG_E_INVALIDFLAG if grfStatFlag is not valid
- STG_E_INVALIDPOINTER if statstg is not a valid pointer.
The following fields of TStatStg are supported:
- dwType: Set to STGTY_STREAM.
- cbSize: Set to the size of the underlying stream.
- pwcsName: Set to the name of the file associated with the stream. This field is only set if the grfStatFlag parameter is set to STATFLAG_NORMAL. When set, the value must be freed using the task allocator.
- mtime: Set to the last modification time of any file whose handle is associated with the wrapped THandleStream.
- ctime: Set to the creation time of any file whose handle is associated with the wrapped THandleStream.
- atime: Set to the last access time of any file whose handle is associated with the wrapped THandleStream.
Other fields are set to zero.