[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6284] Dir.mkpath

From: Aleksi Niemel<aleksi.niemela@...>
Date: 2000-11-11 19:53:49 UTC
List: ruby-talk #6284
May I propose an add to standard library, namely method mkpath to class Dir.
(For non-unix-persons, the method makes all the directories needed to have
all directories in the given path.) Here's a definition (just hacked, once
tested, so beware):

  class Dir
    def Dir.mkpath(path)
      dname = ''
      path.split('/').each do |tmp|
        dname << tmp + "/"
        Dir.mkdir dname unless File.directory? dname
      end
    end
  end

I've coded this method twice, and I just tried to install one kit from RAA
implementing the same thing. I failed to install because it had a bug. So I
fixed it, but started to think that maybe people shouldn't recode this all
the time.

I'm afraid this version isn't good enough to be translated to C immediately
(like, I just noted it might be good to use File.SEPARATOR instead of '/',
maybe add some error handling, handle permissions and umask etc) but this is
just start for discussion.

	- Aleksi

In This Thread

Prev Next