create_directories Function

Creates a directory from a specified file name. Also creates intermediate directories as required.

template<class Path>
inline bool create_directories(
   const Path& Pval
);

Parameters

  • Pval
    An Path object that contains a directory path. Path can be either a basic_path or a type that's derived from basic_path.

Return Value

true if the directory creation succeeds; false if the directory already exists.

Remarks

If the directory cannot be created, the function throws a basic_filesystem_error.

Requirements

Header: filesystem

Namespace: std::tr2::sys

See Also

Reference

<filesystem>

Other Resources

C++ Standard Library Header Files