What do new Windows 8/10 attributes mean: No scrub file (X), Integrity (V), Pinned (P), Unpinned (U)
There are new attributes I didn't know about.
V
Integrity attribute.
This is related to checking for file corruption:
Integrity-streams - ReFS uses checksums for metadata and optionally for file data, giving ReFS the ability to reliably detect corruptions.
Source Resilient File System (ReFS) overview
FILE_ATTRIBUTE_INTEGRITY_STREAM
The directory or user data stream is configured with integrity (only supported on ReFS volumes). It is not included in an ordinary directory listing. The integrity setting persists with the file if it's renamed. If a file is copied the destination file will have integrity set if either the source file or destination directory have integrity set.
Source File Attribute Constants
X
No scrub file attribute.
This is related to error correction:
Proactive error correction - In addition to validating data before reads and writes, ReFS introduces a data integrity scanner, known as a scrubber. This scrubber periodically scans the volume, identifying latent corruptions and proactively triggering a repair of corrupt data.
Source Resilient File System (ReFS) overview
FILE_ATTRIBUTE_NO_SCRUB_DATA
The user data stream not to be read by the background data integrity scanner (AKA scrubber). When set on a directory it only provides inheritance. This flag is only supported on Storage Spaces and ReFS volumes. It is not included in an ordinary directory listing.
Source File Attribute Constants
P
Pinned attribute.
This indicates that the file is a Sparse File:
A sparse file has an attribute that causes the I/O subsystem to allocate only meaningful (nonzero) data. Nonzero data is allocated on disk, and non-meaningful data (large strings of data composed of zeros) is not. When a sparse file is read, allocated data is returned as it was stored; non-allocated data is returned, by default, as zeros.
NTFS deallocates sparse data streams and only maintains other data as allocated. When a program accesses a sparse file, the file system yields allocated data as actual data and deallocated data as zeros.
NTFS includes full sparse file support for both compressed and uncompressed files. NTFS handles read operations on sparse files by returning allocated data and sparse data. It is possible to read a sparse file as allocated data and a range of data without retrieving the entire data set, although NTFS returns the entire data set by default.
With the sparse file attribute set, the file system can deallocate data from anywhere in the file and, when an application calls, yield the zero data by range instead of storing and returning the actual data. File system application programming interfaces (APIs) allow for the file to be copied or backed as actual bits and sparse stream ranges. The net result is efficient file system storage and access. Next figure shows how data is stored with and without the sparse file attribute set.
Source NTFS Sparse Files
FILE_ATTRIBUTE_SPARSE_FILE
A file that is a sparse file.
Source File Attribute Constants
Further Reading
- An A-Z Index of the Windows CMD command line
- A categorized list of Windows CMD commands
- attrib - Display or change file attributes.
There are actually more new attributes found in C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\winnt.h
:
FILE_ATTRIBUTE_UNPINNED = 0x00100000
FILE_ATTRIBUTE_PINNED = 0x00080000
FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = 0x00400000
Only the last one is documented at https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117%28v=vs.85%29.aspx
Based on https://techcommunity.microsoft.com/t5/OneDrive-for-Business/Files-on-demand-difference-in-locally-available-and-always/m-p/118203#M2781 my guess is that the "Pinned" flag is used to prevent that the file is purged from local storage when running low on disk space. The "Unpinned" attribute, OTOH, seems to be used to indicate that you want to force that the file is not stored locally.
I'm currently investigating how these attributes are used by the new "OneDrive Files On Demand" feature (https://support.office.com/en-us/article/Learn-about-OneDrive-Files-On-Demand-0E6860D3-D9F3-4971-B321-7092438FB38E).
See https://social.technet.microsoft.com/Forums/windows/en-US/375f3933-fcab-450c-bb9c-da54155549e2/how-do-i-getset-onedrive-files-on-demand-status-from-powershell?forum=ITCG if you want to learn from these investigations.