
If a file being copied has a data stream and the network redirector is used, the file can only be copied if the client has both the read permission and the read attributes permission. If another process has opened a stream without the FILE_SHARE_DELETE permission, you cannot open the file for delete access. When delete access is requested on a file, the operating system checks for delete access on all open streams in a file. Sharing modes are also maintained per stream. Opportunistic locks are maintained per stream. The file times for a file are updated when any stream in a file is updated. There are no file times associated with a stream. GetFileAttributes, GetFileAttributesEx, GetFileAttributesTransacted, GetFileInformationByHandle, and GetFileInformationByHandleEx return the sparse state of the default data stream if no stream is specified. The FILE_ATTRIBUTE_SPARSE_FILE attribute on the file is set in the dwFileAttributes member of the WIN32_FIND_DATA structure returned from the FindFirstFile, FindFirstFileEx, and FindNextFile functions if any of the streams have ever been sparse. The valid data length (VDL) is the number of bytes that are initialized from the allocation size for the stream.Įach stream also maintains its own state for compression, encryption, and sparseness.The actual size is the number of bytes that are being used by a caller.


For example, you can create a stream that contains search keywords, or the identity of the user account that creates a file.Įach stream that is associated with a file has its own allocation size, actual size, and valid data length: In the NTFS file system, streams contain the data that is written to a file, and that gives more information about a file than attributes and properties.
