Radek
Radek

Reputation: 11121

'Dir' where path contains spaces under windows doesn't work? (ruby)

not sure if it matters that I run the code from haml

this line works nicely

- files = Dir['*']

but here I suspect the spaces in the path....

- files = Dir["C:\Program Files\TestPro\TestPro Automation Framework410\Output Files\builds\*.xml"]

Upvotes: 1

Views: 1931

Answers (1)

Gabriel
Gabriel

Reputation: 18780

most unicode style strings use escape character \ but windows allows both \ and / for path declarations.

- files = Dir["C:/Program Files/TestPro/TestPro Automation Framework410/Output Files/builds/*.xml"]

Upvotes: 1

Related Questions