Morton Goldberg
8/3/2006 11:29:00 PM
I'm on an Mac OS X box, and you appear to be on Windows box, so file
system differ (I don't have drive letters to contend with), but have
tried
Dir.glob("#{drive_letter}:*\\**\\CFI-*")
or
Dir.glob("#{drive_letter}:*/**/CFI-*")
Regards, Morton
On Aug 3, 2006, at 7:10 PM, Geoff wrote:
> Yep, your right. However I changed that and ran it, but it still comes
> up with an empty text file (even though there are quite a few
> directories that contain "CFI-").
>
> Morton Goldberg wrote:
>> Shouldn't it be
>>
>> Dir.glob("#{drive_letter}:\\**\\CFI-*")
>>
>> ?? I mean, CFI- isn't a variable.
>>
>> Regards, Morton
>>
>> On Aug 3, 2006, at 6:20 PM, Geoff wrote:
>>
>>> Hey,
>>>
>>> I've been messing with this for hours now and I really thought this
>>> would work! I want to prompt to get the letter of the drive to
>>> search,
>>> then if the directory has the text "CFI-" in it, add that full
>>> path as
>>> a line to a text file.
>>>
>>> file = File.open("projects.txt", "w")
>>> print "Enter Drive Letter: "
>>> drive_letter = gets.chomp
>>> Dir.glob("#{drive_letter}:\\**\\{CFI-}*") do |f|
>>> file << "#{f} \n"
>>> end
>>>
>>> Why is this not working?
>
>