From: Harry Nash Date: 2009-03-02T00:23:14+09:00 Subject: Re: How to use the Dir class, search for a sub directroy I removed the * as I only want exact match. There are only artist folders such as ABBA acdc they do not have additional folders. I do agree with you comment below; strange though, if I change the folder ABBA to FBBA my code returns no match found, then I change the name back to ABBA, I get found match. Sooo it does work, yet if it's wrong it will then break some time. I think a different Dir class command is needed not glob, I am trying only for a ture or false return not the aray. Again thanks for your input; and on Sunday too! badboy wrote: > Harry Nash schrieb: >> end >> > Dir.glob returns an array, not a string, so your "if artist != > artist_check" will fail. > also, you won't find folders/files like "abba album" with your search, > if you want this add the star ("*") > artist is already a string, so no need for "#{...}", just use artist > and at last: > if you changed the if-construct it will fail, if Dir.glob found "abba", > because your "artist" is "Abba" ;) -- Posted via http://www.ruby-forum.com/.