1

For example, I want to create a folder named "AC/DC". What should I do?

Dir.mkdir("AC/DC")

will give an error message like this

in `mkdir': No such file or directory @ dir_s_mkdir - AC/DC (Errno::ENOENT)
sawa
  • 165,429
  • 45
  • 277
  • 381
tga
  • 538
  • 4
  • 15
  • 1
    I don't think that is allowed at the OS level. – sawa Feb 06 '16 at 10:47
  • 1
    Possible duplicate of [How to create directories recursively in ruby?](http://stackoverflow.com/questions/3686032/how-to-create-directories-recursively-in-ruby) – SOFe Feb 06 '16 at 11:24

1 Answers1

2

Have you considered using an alternative UNICODE character instead of a standard forward slash?

Perhaps you could use:

'FULLWIDTH SOLIDUS' (U+FF0F) http://www.fileformat.info/info/unicode/char/ff0f/index.htm

Dir.mkdir("AC/DC")

or

'DIVISION SLASH' (U+2215) http://www.fileformat.info/info/unicode/char/2215/index.htm

Dir.mkdir("AC∕DC")
GavinBrelstaff
  • 3,016
  • 2
  • 21
  • 39