Skip to Main Content
Close Menu

Updating deprecated FILE_CREATE_DIRECTORY calls in Drupal 8


This covers only the most common use cases.





More examples

We have a set of examples as part of the Drupal Rector rector_examples module. See

Automating updates with Drupal Rector

Drupal Rector is an open source tool built using Rector which can help automate this deprecation as well as other common deprecations.

For more information, see

What is covered by the rector

Drupal Rector currently replaces uses of FILE_CREATE_DIRECTORY as shown above.

Improvement opportunities

Drupal Rector does not add a use statement to classes.

Deprecation background

No change record was found for this change.

The FileSystemInterface allows replacing the standard file_system service to customize specifics while inheriting most of the shared functionality.


No change record was found for this change.

Credits and thank yous

Thank you to Dan Montgomery for leading Drupal Rector development to support this deprecation.

Thank you to for sponsoring this development.

Let’s work together.

Have an exceptional idea? Let's talk and see how we can help.
Contact Us