OS independent way to read/write paths?

Guys,

I'm running into some problems running scripts on Windows that do file
path mangling. Problem is that it appears Ruby converts all windows paths
to forward slashes as opposed to back slashes...fine by me, but I need to
write them out on occasion for consumption by other Windows programs or
batch files, and then I have a problem.

I know this would be a relatively simple thing to handle on my own, but
wanted to know if, by my newness to Ruby, I'm missing a wheel that's
already been invented. What's the idiomatic way of handling this sort of
problem?

Thanks!
John

winpath = rubypath.gsub(%r{/}, "\\")

:wink:

-austin

ยทยทยท

On 8/23/05, John Wells <lists@sourceillustrated.com> wrote:

I'm running into some problems running scripts on Windows that do file
path mangling. Problem is that it appears Ruby converts all windows paths
to forward slashes as opposed to back slashes...fine by me, but I need to
write them out on occasion for consumption by other Windows programs or
batch files, and then I have a problem.

I know this would be a relatively simple thing to handle on my own, but
wanted to know if, by my newness to Ruby, I'm missing a wheel that's
already been invented. What's the idiomatic way of handling this sort of
problem?

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca