Use mkdir with -p flag to avoid errors on existing directories.