async def make_directory(self, path, *, parents=True):
path = pathlib.PurePosixPath(path)<EOL>need_create = []<EOL>while path.name and not await self.exists(path):<EOL><INDENT>need_create.append(path)<EOL>path = path.parent<EOL>if not parents:<EOL><INDENT>break<EOL><DEDENT><DEDENT>need_create.reverse()<EOL>for path in need_create:<EOL><INDENT>await self.command("<STR_LIT>" + str(path), "<STR_LIT>")<EOL><DEDENT>
:py:func:`asyncio.coroutine`

Make directory.

:param path: path to directory to create
:type path: :py:class:`str` or :py:class:`pathlib.PurePosixPath`

:param parents: create parents if does not exists
:type parents: :py:class:`bool`