<p>In Craft 3, the <code>IOHelper</code> class has been replaced by the <a href="https://docs.craftcms.com/api/v3/craft-helpers-filehelper.html" rel="nofollow noreferrer"><code>FileHelper</code></a> class.</p>

<p>The closest Craft 3 equivalent to <code>IOHelper::ensureFolderExists()</code> is </p>

<pre><code>FileHelper::createDirectory($path);
</code></pre>

CC BY-SA 4.0
2019-01-18T13:08:01.190Z
2019-01-18T13:08:01.190Z
Mats Mikkel Rummelhoff
<p>Migrating Plugins to Craft 3 starts bugging me, seems that really everything changed.
Is there an equivalent to <code>IOHelper::ensureFolderExists</code> in Craft 3?</p>

<plugin-development><migration>
Is there an equivalent to IOHelper::ensureFolderExists in Craft 3?
# Is there an equivalent to IOHelper::ensureFolderExists in Craft 3?

(Asked by: username_0 on 2019-01-18)

Migrating Plugins to Craft 3 starts bugging me, seems that really everything changed.
Is there an equivalent to `IOHelper::ensureFolderExists` in Craft 3?

**Tags:** plugin-development, migration


---

## 1 answers

### Answer by username_1 on 2019-01-18. Score: 3

In Craft 3, the IOHelper class has been replaced by the FileHelper class.
The closest Craft 3 equivalent to IOHelper::ensureFolderExists() is 
FileHelper::createDirectory($path);


---

