Harry Nash schrieb: > Good day, I am learning Ruby,and doing some experaments. > I have a bit of code that searches the header of MP3 files > in a folder to get file 1 artist name. This is a variable artist. > Now I try to search a diferent directory and see if > a sub directory has the same name. So letts say the artist > is Abba and I do have a sub folder in e:\music with ABBA > how do I use Dir class to evaluate if Abba is found. I tried > changing Abba to ABBA and still I do not get expected results. > > Artist = ABBA > Dir.chdir("e:/music") > Dir["#{artist}"] > > I tried a number of things here, I need a positive or negitave > return; and, how to get the return value. > > OH > Is there a way to mark a post as answered? try this: artist = 'ABBA' Dir.glob("*#{artist}*", File::FNM_CASEFOLD) the * means anything before and after your search string, FNM_CASEFOLD => case insensitive this could be easily found out by reading the rdoc at: http://www.ruby-doc.org/core/classes/Dir.html#M002347 http://www.ruby-doc.org/core/classes/File.html#M002603