Creating Filters

 

Filters are a useful way to analyze disk utilization by file types, names, owner, attributes, size or date.  For example, if you only want to analyze disk space used by Microsoft Office related files you can set up a filter to only include files that have an extension of doc, xls, ppt, etc. 

 

Filters are created and managed via the Tools > Filters menu item.  DiskFerret provides several preconfigured filters for commonly used file types, such a video files, audio files, and temporary files.  You can add or remove items from the preconfigured filters or you can create your own filters.  Once configured, filters are very easy to turn on and off as needed.  See the Using Filters section for more information on using filters.

Filters

A filter is a set of one or more filter rules and a filter rule is a set of file wildcards, owner wildcards, file attributes, size and/or dates that are used to include or exclude a folder or file from the data views.  To create a filter you start by giving the filter a name, and then add one of more filter rules.

 

 

Filter Rules

Filter rules consist of a combination of file name filters, owner name filters, file attributes, file sizes and/or file dates. 

 

Wildcards

The File name filters and File owner filters sections are multi-line text fields.  Each line represents a wildcard specification or a comment.  Comments are lines that start with a semicolon (;) and provide a method to document the intent of your wildcards.

 

Wildcards can be specified as either an *, or a ? and can be used in the File name filters or the Owner name filters section.  An asterisk (*) is used to match one or more characters in a file or owner name.  A question mark (?) is used to match only one character in a file or owner name.  To configure a filter rule to include only Microsoft Word and Excel documents you could use the following File name filters:

*.doc

*.xls

 

Include/Exclude

Filter Rules can be specified as include rules, or as exclude rules.  Suppose you want to use the filter above to find all Word and Excel files, but you do not want to include files that start with “invoice”.  In this case you could specify the wildcards shown above to be an include rule and specify invoice* in another rule that is part of the same filter.  Exclude rules are always evaluated before include rules, therefore in this example if DiskFerret encountered a file named “invoice385328-1.doc” the file would be eliminated from consideration by the exclude rule before it is evaluated by the include rule. 

 

Regular Expressions

Regular expressions provide a concise and flexible means for identifying strings of text (i.e., file names) and are supported.  A full explanation of regular expressions is beyond the scope of this document, however many information sources are available on the internet.  If you want to use regular expressions instead the simpler wildcards (* and ?), check the Regular expressions checkbox.  Wildcards and regular expressions cannot be used within the same filter rule.

 

Attributes

The attribute section lets you specify which file attributes, if any, that you want to use for the filter.  The “Filter on file attributes” checkbox must be checked before any attributes will be used by the filter rule.  If you are unfamiliar with file attributes the following table list Microsoft’s definition for each file attribute:

Member name

Description

Archive

Supported by the .NET Compact Framework.

The file's archive status. Applications use this attribute to mark files for backup or removal.

Compressed

Supported by the .NET Compact Framework.

The file is compressed.

Device

Supported by the .NET Compact Framework.

Reserved for future use.

Encrypted

Supported by the .NET Compact Framework.

The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and directories.

Hidden

Supported by the .NET Compact Framework.

The file is hidden, and thus is not included in an ordinary directory listing.

Normal

Supported by the .NET Compact Framework.

The file is normal and has no other attributes set. This attribute is valid only if used alone.

NotContentIndexed

Supported by the .NET Compact Framework.

The file will not be indexed by the operating system's content indexing service.

Offline

Supported by the .NET Compact Framework.

The file is offline. The data of the file is not immediately available.

ReadOnly

Supported by the .NET Compact Framework.

The file is read-only.

ReparsePoint

Supported by the .NET Compact Framework.

The file contains a reparse point, which is a block of user-defined data associated with a file or a directory.

SparseFile

Supported by the .NET Compact Framework.

The file is a sparse file. Sparse files are typically large files whose data are mostly zeros.

System

Supported by the .NET Compact Framework.

The file is a system file. The file is part of the operating system or is used exclusively by the operating system.

Temporary

Supported by the .NET Compact Framework.

The file is temporary. File systems attempt to keep all of the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.

 

Size

The size section lets you filter based on file sizes with the following operators: greater than, less than, equal to, or between.

Date

The date section lets you filter based on the last modified, created or last accessed date for files with the following operators: greater than, less than, equal to, or between. 

 

Fixed dates or relative dates can be specified.  When specifying relative periods the time frame may be specified in minutes, hours, days, weeks, months, or years.  For example, if you want to find files that have been modified within the last 2 months, set the file date to “Modified”, set the operator field to “After”, set the criteria drop down to “Relative Periods”, set the time frame drop down to “Months”, and set the number field to 2. 

 

Use fixed dates by specifying “Fixed Dates” in the criteria drop down list and specify a date using the date widget , or by entering a date in the format or MM/DD/YYYY.

 

 

Tip:  When a file is evaluated for a match to a filter rule the file must match ANY of the exclude criteria to be excluded, or ALL of the include criteria to be included.