From: daz Date: 2003-05-26T11:57:49+09:00 Subject: Re: Getting '\' to be used as the separator in Dir.getwd -- how to? "Mark Wilson" wrote: > > On Sunday, May 25, 2003, at 05:56 PM, Richard wrote: > > > [snip] > > I don't see any cwd method defined in the Shell class, nor in its > > required modules: > > shell/error > > shell/command-processor > > shell/process-controller > > and it didn't seem I'd find it in any of *their* required modules. (I > > only checked the ftool.rb module) > > > > So how do the separators get transformed? It looks like magic :-) > > > > Regards, > > Richard > attr :cwd defines the method to read @cwd. However, you would be using Shell to do a Dir#getwd instead of doing it directly. It returns forward-slash separators (for me). require 'shell' puts Shell.new.pwd # -> D:/ruby/lib/ruby/1.8/shell > The default record separator is set to '/' unless replaced [...] The default record separator in Shell is set to global variable $/ (which is usually newline). Nothing to do with the directory component separator. Confusing, though. daz