i wonder how does any os address file having spaces in their names.
Even cmd.exe in windows can't access such file but windows explorer can.
How is it so?
So the command line parser knows you want to pass "folder name with spaces" as a single argument to md, rather than the four arguments "folder", "name", "with", and "spaces".
You should advise the user to quote paths which contain spaces. This is common enough requirement that it won't be an issue.
But you could just splice the arguments together, with a single space between them, to form a file path and then try that. (It appeats to be what notepad.exe does.)