Hello --

On Tue, 24 Jul 2001, Paul Brannan wrote:

> > Although it appears attracrive, I don't think it's a good idea to tie
> > File path and String too much.  Path operation should be tied to File,
> > not String.
> >
> > 							matz.
>
> I think I would be inclined to agree.  However, if some easy way of
> joining directory names is not available, then you are going to see code
> like this:
>
> s = "#{foo}/bar/#{filename}.txt"

File::SEPARATOR and File.join take care of this:

   irb(main):012:0> foo = "dir"
   "dir"
   irb(main):013:0> filename = "some_file"
   "some_file"
   irb(main):014:0> s = File.join(foo, "bar", filename + ".txt")
   "dir/bar/some_file.txt"


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav