Hacker News new | ask | show | jobs
by CSSer 1298 days ago
Out of curiosity, what’s the motivation to error suppress the mkdir call here (my PHP is rusty)? Anyway, this is great. Thank you for sharing!
1 comments

It returns an error if the directory already exists (same as in Python)
While we're on the topic, in Python there's a nice way to deal with this:

os.makedirs(path, exist_ok=True)