From: Michael Fellinger Date: 2005-11-22T18:48:14+09:00 Subject: Re: class Dir --nextPart1397569.6AbZrfHZzG Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Dir.new('./').entries.partition {|i| File.directory?(i))} => [ [".", "..", "log", "src", "conf", "_darcs", "public", "script", "templates"], ["README", "run.rb.save", "run.rb"] ] Am Dienstag 22 November 2005 09:52 schrieb Alexander Fleck: > Hi, > what' s the best way to detect if a Dir entry is a directory or file? I' m > doing a Dir.foreach blabla |x|. I' m trying to use 'directory?', but it > doesn' t work the way I use it. > > Thanks, > Alex. --nextPart1397569.6AbZrfHZzG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBDgulXMdQeL6eBxhIRAl2dAJ4hGsoDG1B7KHjsFwM/aNOa7UhpawCbBvyL GbDkzgUr6/xwYYuuQiVFXhE= =GsPo -----END PGP SIGNATURE----- --nextPart1397569.6AbZrfHZzG--