Sha256: f607f0ab260b61c48fc0f878624419948e8e95080bb70e0fd25c7a975e1017c7

Contents?: true

Size: 947 Bytes

Versions: 20

Compression:

Stored size: 947 Bytes

Contents

---
title: About the directory Resource
platform: os
---

# directory

Use the `directory` InSpec audit resource to test if the file type is a directory. This is equivalent to using the `file` resource and the `be_directory` matcher, but provides a simpler and more direct way to test directories.

<br>

## Availability

### Installation

This resource is distributed along with InSpec itself. You can use it automatically.

### Version

This resource first became available in v1.0.0 of InSpec.

## Syntax

A `directory` resource block declares the location of the directory to be tested, and then one (or more) matchers.

    describe directory('path') do
      its('property') { should cmp 'value' }
    end

<br>

## Properties

All of the properties available to `file` may be used with `directory`.

<br>

## Matchers

For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
inspec-core-2.3.10 docs/resources/directory.md.erb
inspec-2.3.10 docs/resources/directory.md.erb
inspec-core-2.3.5 docs/resources/directory.md.erb
inspec-2.3.5 docs/resources/directory.md.erb
inspec-core-2.3.4 docs/resources/directory.md.erb
inspec-2.3.4 docs/resources/directory.md.erb
inspec-core-2.2.112 docs/resources/directory.md.erb
inspec-2.2.112 docs/resources/directory.md.erb
inspec-core-2.2.102 docs/resources/directory.md.erb
inspec-2.2.102 docs/resources/directory.md.erb
inspec-core-2.2.101 docs/resources/directory.md.erb
inspec-2.2.101 docs/resources/directory.md.erb
inspec-core-2.2.78 docs/resources/directory.md.erb
inspec-2.2.78 docs/resources/directory.md.erb
inspec-core-2.2.70 docs/resources/directory.md.erb
inspec-2.2.70 docs/resources/directory.md.erb
inspec-core-2.2.64 docs/resources/directory.md.erb
inspec-2.2.64 docs/resources/directory.md.erb
inspec-core-2.2.61 docs/resources/directory.md.erb
inspec-2.2.61 docs/resources/directory.md.erb