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

</div>

Module

# Xojo.IO.SpecialFolder

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

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `SpecialFolder</api/files/specialfolder>` as a replacement.

</div>

## Description

The SpecialFolder modules provides access to OS-specific folders.

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                           | Parameters                               | Returns                             | Shared |
|----------------------------------------------------------------|------------------------------------------|-------------------------------------|--------|
| `ApplicationSupport<xojo.io.specialfolder.applicationsupport>` |                                          | `FolderItem</api/files/folderitem>` |        |
| `Caches<xojo.io.specialfolder.caches>`                         |                                          | `FolderItem</api/files/folderitem>` |        |
| `Documents<xojo.io.specialfolder.documents>`                   |                                          | `FolderItem</api/files/folderitem>` |        |
| `GetResource<xojo.io.specialfolder.getresource>`               | name As `String</api/data_types/string>` | `FolderItem</api/files/folderitem>` |        |
| `Temporary<xojo.io.specialfolder.temporary>`                   |                                          | `FolderItem</api/files/folderitem>` |        |

## Method descriptions

<div id="xojo.io.specialfolder.applicationsupport">

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

</div>

<div class="rst-class">

forsearch

</div>

Xojo.IO.SpecialFolder.ApplicationSupport

**ApplicationSupport** As `FolderItem</api/files/folderitem>`

The location of application support files.

| Windows                     | Mac                                         | Linux           | iOS                           |
|-----------------------------|---------------------------------------------|-----------------|-------------------------------|
| UsersUserNameAppDataRoaming | /Users/UserName/Library/Application Support | /home/UserName/ | ../Library/ApplicationSupport |

<div class="warning">

<div class="title">

Warning

</div>

A `RuntimeException</api/exceptions/runtimeexception>` will be raised if the folder does not exist.

</div>

``` xojo
Dim appSupport As Xojo.IO.FolderItem
appSupport = Xojo.IO.SpecialFolder.ApplicationSupport
```

<div id="xojo.io.specialfolder.caches">

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

</div>

<div class="rst-class">

forsearch

</div>

Xojo.IO.SpecialFolder.Caches

**Caches** As `FolderItem</api/files/folderitem>`

The OS folder for storing cache data.

{\| class="genericTable" ! width=25% \| Windows ! width=25% \| Mac ! width=25% \| Linux ! width=25% \| iOS C:UsersUserNameAppDataLocalMicrosoftWindowsINetCache\| /Users/UserName/Library/Caches \| /home/UserName/.cache/ \| ../Library/Caches }

<div class="warning">

<div class="title">

Warning

</div>

A `RuntimeException</api/exceptions/runtimeexception>` will be raised if the folder does not exist.

</div>

``` xojo
Dim cache As Xojo.IO.FolderItem
cache = Xojo.IO.SpecialFolder.Caches
```

<div id="xojo.io.specialfolder.documents">

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

</div>

<div class="rst-class">

forsearch

</div>

Xojo.IO.SpecialFolder.Documents

**Documents** As `FolderItem</api/files/folderitem>`

The Document folder is where you will likely want to place most user-created files or data.

| Windows                  | Mac                       | Linux                     | iOS          |
|--------------------------|---------------------------|---------------------------|--------------|
| C:UsersUserNameDocuments | /Users/UserName/Documents | /home/UserName/Documents/ | ../Documents |

<div class="warning">

<div class="title">

Warning

</div>

A `RuntimeException</api/exceptions/runtimeexception>` will be raised if the folder does not exist.

</div>

``` xojo
Dim docFile As Xojo.IO.FolderItem
docFile = Xojo.IO.SpecialFolder.Documents.Child("MyDocument.txt")
```

<div id="xojo.io.specialfolder.getresource">

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

</div>

<div class="rst-class">

forsearch

</div>

Xojo.IO.SpecialFolder.GetResource

**GetResource**(name As `String</api/data_types/string>`) As `FolderItem</api/files/folderitem>`

Gets the specified file (by name) located in the Resource folder of the app's main bundle (Mac or iOS) or in the Resource folder on Windows, Linux and console apps.

Use a Copy Files Build Step to copy files into the Resource folder.

<div class="warning">

<div class="title">

Warning

</div>

An `InvalidArgumentException</api/exceptions/invalidargumentexception>` will be raised if the file the does not exist.

</div>

Gets a file that has been copied to the Resource folder:

``` xojo
Dim bundleFile As Xojo.IO.Folderitem
bundleFile = Xojo.IO.SpecialFolder.GetResource("AppDatabase.sqlite")
```

<div id="xojo.io.specialfolder.temporary">

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

</div>

<div class="rst-class">

forsearch

</div>

Xojo.IO.SpecialFolder.Temporary

**Temporary** As `FolderItem</api/files/folderitem>`

The user's temporary folder.

{\| class="genericTable" ! width=25% \| Windows ! width=25% \| Mac ! width=25% \| Linux ! width=25% \| iOS C:UsersUserNameAppDataLocalTemp\| /var/folders/gp/wtyftxf176l22dz9qlwqw5v40000gn/T (varies) \| /tmp/ \| .../tmp }

<div class="warning">

<div class="title">

Warning

</div>

A `RuntimeException</api/exceptions/runtimeexception>` will be raised if the folder does not exist.

</div>

``` xojo
Dim tmp As Xojo.IO.FolderItem
tmp = Xojo.IO.SpecialFolder.Temporary
```

## Notes

For desktop, web and console projects you can create a Xojo.IO.FolderItem from a FolderItem returned from a classic framework class or method. Use this to access the classic SpecialFolder for more available locations:

``` xojo
Dim desktopClassic As FolderItem = SpecialFolder.Desktop
Dim desktop As New Xojo.IO.FolderItem(desktopClassic.NativePath.ToText)
```

All path locations noted for the methods below are from recent versions of the various operating systems. Keeps in mind that paths can vary across OS versions and in the case of Linux, specific distributions. These operating systems were used to determine paths: \* Windows 10 Anniversary Edition \* macOS Sierra 10.12.1 \* Linux Mint 18 \* iOS 10.1

## Compatibility

All project types on all supported operating systems.

## See also

`FolderItem</api/files/folderitem>` class
