------art_29932_32027799.1131377089132
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

hi,
i want my program to print all files and directories in a given directory,
then print files and dirs in subdirectories, without it showing the name of
the subdirectory..
but for some reason, it doesn't execute the method again for the
subdirectories found in the current directory..
greetings, Dirk.


 2005/11/7, Brian Schröäer <ruby.brian / gmail.com>:
>
> On 07/11/05, Dirk Meijer <hawkman.gelooft / gmail.com> wrote:
> > [snip badly formated code]
>
> def foo(string)
> arr = [string]
> puts arr
> arr.each do |b|
> foo(b)
> end
> end
> foo("foobar")
>
> That is a very complicated way of writing
>
> def foo(a)
> foo(a)
> end
> foo("foobar")
>
> What do you want to achieve here?
>
> >
> > require 'find'
> > def index(dir, filename=dir)
> > list=[]
> > dirs=[]
> > Find.find(dir) do |filename|
> > list << filename.split(/\/|\.\//)
> >
> > end
> > list.each do |file|
> > if file.length < 3
> > puts file
> > else
> > dirs << file[0]
> > end
> > end
> > dirs.each do |name|
> > index(name)
> > end
> > end
> >
> > index(".","index")
> >
> > i just don't see it..
> >
> > greetings, Dirk.
> >
> >
>
> What do you want to achieve with the above. I suppose you'll get
> better answers if you describe your problem than by submitting
> obfuscated code.
>
> cheers,
>
> Brian
>
> --
> http://ruby.brian-schroeder.de/
>
> Stringed instrument chords: http://chordlist.brian-schroeder.de/
>
>

------art_29932_32027799.1131377089132--