<div class="meta" robots="noindex">

</div>

Property

# FolderItem.Directory

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `FolderItem.IsFolder<folderitem.isfolder>` as a replacement.

</div>

## Description

`True</api/language/true>` if the **FolderItem** is a <span class="title-ref">Directory</span> (a folder).

## Sample code

Prompt the user to choose a folder and then display the number of files it contains:

``` xojo
Dim f As FolderItem
f = SelectFolder

If f.Directory Then
  MsgBox("The folder has " + Str(f.Count) + " files.")
Else
  MsgBox("The folderitem is not a directory!")
End If
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This code checks for a specific folder on the drive:

``` xojo
Dim f As FolderItem
f = GetFolderItem("Resources")
If f <> Nil And f.Exists And f.Directory Then
  ' The folder exists so fetch a file from it
  Dim file As FolderItem = f.Child("sample.html")
End If
```

## Compatibility

All project types on all supported operating systems.
