JCL Help:NtfsFindFirstStream

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Starts the enumeration of streams in a file.


Pascal

 function NtfsFindFirstStream(const FileName: string; StreamIds: TStreamIds; var Data: TFindStreamData): Boolean;


Parameters

Parameters Description
const FileName: string The fully qualified name of the file for which to enumerate the streams it contains. The specified file must reside on an NTFS formatted volume.
StreamIds: TStreamIds Set of stream IDs which denotes which streams are enumerated. For more information about stream IDs see the documentation for TStreamIds.
var Data: TFindStreamData Record which, upon successful return, contains information about the first found stream. This information includes the stream name, size and attributes. For more information see the documentation for TFindStreamData.


Return Value

If the function succeeds it returns True, if it fails it returns False. In the latter case you can call GetLastError to retrieve more information about the reason of failure. If the function succeeds you must eventually release the context resources stored in the Data record by calling NtfsFindStreamClose. In case of failure this is unnecessary (in fact FindStreamClose will return False).


Description

Use NtfsFindFirstStream to kick off the enumeration of streams in the specified file. You can limit the enumeration to specific streams through the StreamIds set and information about the first found stream is returned through the Data parameter. Use NtfsFindStreamNext to continue the enumeration and NtfsFindStreamClose to end it. Note that the enumeration of streams requires that the caller has the SE_BACKUP_NAME and SE_RESTORE_NAME privileges. To avoid confusion, the streams enumerated by this function are the kind of streams that have been supported by the NTFS filesystem since its inception, not the kind of streams referred to when one speaks of (COM) structured storage files.


See Also

NtfsFindNextStream NtfsFindStreamClose TFindStreamData


About

Unit

JclNTFS


Donator

Marcel van Brakel


Notes

The set of functions for the enumeration of streams was adapted from the PSDK sample EnumStreams.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page