diskscanner SearchAttributes property
Return to Introduction  Previous page  Next page
Applies to
dcDiskScanner and dcMultiDiskScanner components.  

  TdcScanAttribute = (saNormal, saArchive, saReadOnly, saHidden, saSystem, saDirectory, saAny);  
  TdcScanAttributes = set of TdcScanAttribute;  
property SearchAttributes: TdcScanAttributes;  

The SearchAttributes property specifies the possible file attributes for files or directories that should be found by dcDiskScanner component.  

saNormalThe file or directory has normal or no attributes set. If True, DiskScanner will find files even without any attributes set.  
saArchiveThe file or directory is an archive file or directory. This is standard file attributes. Applications use this flag to mark files for backup or removal. Set saArchive flag to True to find files with Archive attributes set.  
tip This is normal DOS attribute that means that file is archived or copied to hard disk. Make saArchive True to find files with Archive attributes set. This file attribute usually obsolete in win32 systems, because all files kept on hard drives and even if they copied to floppy or CD, this attribute not cleaned. Anyway, this file attribute still used on most files.  
saReadOnlyAttribute means that file or directory have read-only permission. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it. Set saReadOnly to True to find files with Read-only attributes set.  
saHiddenThe file or directory is hidden. It is not included in an ordinary directory listing. Make saHidden True to find hidden files (note that hidden directories will not be found, unless the saDirectory is specified).  
tip OS hide most files which destruction lead to system failure (such files like IO.SYS, MSDOS.SYS and so forth).  
saSystemThe file or directory is part of, or is used exclusively by the operating system. Make saSystem True to find system files.  
saDirectoryThe "file or directory" is a directory (folder). Make saDirectory True to find directories (tip if saHidden is True, DiskScanner will also find hidden directories, i.e: "Recycled". tip To find ALL directories, which even does not match SearchMask — set FindAllFolders property to True).  
saAnyAll (or any) attributes is set. Set saAny property to True to find files or directories with ANY file attributes.  

Following example demonstrates how to set or remove attributes in the SearchAttributes property. Let's suppose, we would like to add or remove from search results "hidden" files…  
// to add attribute  
dcDiskScanner1.SearchAttributes := dcDiskScanner1.SearchAttributes + [saHidden];  
// to remove attribute  
dcDiskScanner1.SearchAttributes := dcDiskScanner1.SearchAttributes - [saHidden];  
C++ Builder  
// to add attribute  
dcDiskScanner1->SearchAttributes = dcDiskScanner1->SearchAttributes << saHidden;  
// to remove attribute  
dcDiskScanner1->SearchAttributes = dcDiskScanner1->SearchAttributes >> saHidden;  

See also
FindAllFolders, Matches, SearchMask, SearchSize and SearchTime properties.