create a folder out of working folder without use of double period with Dir.mkdir

36 Views Asked by At

Is it possible to create a folder outside of working folder without direct use of double period with ruby's Dir.mkdir s or mkdir_p s. I am interested in linux-like systems only.

My goal it to sanitise a user provided folder name, I plan to keep single stops for 'name extension purposes'

Tildes and control characters are also removed.

Note that I am aware that it is possible to merely compare normalised names of working folders and user suggested, yet I am more interested in performing silent sanitation by dropping/replacing unsafe elements rather than producing an error message.

0

There are 0 best solutions below