ha
2013-04-22 21:26:17 UTC
Hi guys,
I've been going through the docs and the documentation I find always gets
the directory first and then get the file to be destroyed.
I got a simple script running and it works like a champ!
The script is like this:
*require 'fog'
*
*
*
*conn = Fog::Storage.new(
*
* provider: 'Rackspace',*
* rackspace_username: 'username',*
* rackspace_api_key: 'key'*
*)*
*
*
*directory = conn.directories.get('mycontainer')
*
*
*
*f = directory.files.head("path/file1.jpg")*
*puts "Should return file: #{f.inspect}"*
*f.destroy if f*
My big problem is that I know the path of the file "path/file1.jpg" (which
is the key attribute to the file) but not the container name, and I have
about 20 different containers.
Is there a method that works like a search file that receives the file key?!
I don't know why the container is not saved along with 'path/file1.jpg' but
I'm already thinking on adding it, I just want to know if I will have to do
that before or after cleaning my containers.
Anyway, if there is no search I'll have to brute force and iterate through
all containers all files to delete the old files...
Thanks in advance,
./Helio
I've been going through the docs and the documentation I find always gets
the directory first and then get the file to be destroyed.
I got a simple script running and it works like a champ!
The script is like this:
*require 'fog'
*
*
*
*conn = Fog::Storage.new(
*
* provider: 'Rackspace',*
* rackspace_username: 'username',*
* rackspace_api_key: 'key'*
*)*
*
*
*directory = conn.directories.get('mycontainer')
*
*
*
*f = directory.files.head("path/file1.jpg")*
*puts "Should return file: #{f.inspect}"*
*f.destroy if f*
My big problem is that I know the path of the file "path/file1.jpg" (which
is the key attribute to the file) but not the container name, and I have
about 20 different containers.
Is there a method that works like a search file that receives the file key?!
I don't know why the container is not saved along with 'path/file1.jpg' but
I'm already thinking on adding it, I just want to know if I will have to do
that before or after cleaning my containers.
Anyway, if there is no search I'll have to brute force and iterate through
all containers all files to delete the old files...
Thanks in advance,
./Helio
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.