Hi everybody, in my application, I want to offer file downloads on a per-user basis. That means, a user has to authenticate and gets assigned a user_id. Now, in my filesystem, I have a directory for each user_id (above webroot, of course) which contains subdirectories and files. What I want to do is offer the files under each user''s directory for download. These files are uploaded or updated at random intervals with rsync from another server. I have figured out how to secure the download part with Apache and xsendfile, and it works fine. But, what I need help with is, whenever there have been uploaded new files, I want to have a rake task that scans the directories for all the users and writes each file with it''s path into a db table. I also would like to get access to all the dir names and filenames found, so I can split them up and use them as keys etc. I searched the Rails groups but haven''t really found any pointers how this could be done. Thanks for any help you can give me. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mike Nicholaides
2008-Apr-12 21:47 UTC
Re: How do I scan a directory tree using a Rake task?
This is more a ruby question than a rails question. Maybe try in the Ruby forum. I assume you''ve already investigated the built in Dir#glob method -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---