开发者

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

开发者 https://www.devze.com 2023-01-20 02:26 出处:网络
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....

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\O开发者_开发问答utput Files\builds\*.xml"]


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"]
0

精彩评论

暂无评论...
验证码 换一张
取 消