dirs = ["/Users/aragon/Sites"]
excludes = []
for dir in dirs
Find.find(dir) do |path|
if FileTest.directory?(path)
if excludes.include?(File.basename(path))
Find.prune # Don’t look any further into this directory.
else
next
end
else
puts path
end
end
end
Find.find(dir) do |path|
end
I believe this is more complex than it needs to be, or I didn’t
understand
your original request. Please see my other post.
structure? If the former, which parts of the file information do you
need?
I need the complete path - no filenames (dirname, basename?).
I need no additional file information - only the complete path.
Your reply is ambiguous. Do you want the filename to be included in the
path? “No filenames” implies that the filename should be omitted, but
“complete path” implies that the filename should included.
Could you please point me to a better solution?
Only with better information. How are the FTP users organized? What kind
of drop-down menu, using what GUI library?
All FTP users a stored in a mysql database, uid, gid, MaxMB,
DownloadBandwith … The admin tool runs under apache and Ruby on
Rails.
Is the directory path search related in any way to the FTP list?
I think it would be better to post the Ruby on Rails inquiry in the Ruby
on
Rails newsgroup.
Here is a way to get a list of complete file paths for a given pathname
argument. This example filters for specific graphic file suffixes, but
you
can change this to suit your own requirements: