First feedback about the library

20 views
Skip to first unread message

Joacchim

unread,
Feb 8, 2011, 6:14:48 AM2/8/11
to SCOP
Hello,

I had a hard time using the library for the first time only to list
every bucket and every files in those buckets, as well as using it to
create a new bucket.

Actually, I'd say that the problem lies half in a lack of
documentation of the libarry, and half in my lack of knowledge of how
the S3 API works.

Here is the problem I came across :
I found the prototype matching my interest,
dpl_status_t dpl_list_bucket(dpl_ctx* ctx, char*bucket, char* prefix,
char* delim, dpl_vec_t** obj, dpl_vec_t** prefixes);
where the prefix and delim were stated as optional, but still i
thought that giving "/" as the path prefix would not be a bad idea,
and put the default DPL delimiter into the delim parameter.

The result i got was : nothing. There was no failure, but i didn't
find any object in the buckets.
I then read the code of the dplsh tool, and found that without giving
the prefix, the delim AND the prefixes, I'd get the awaited result.

My point is that the documentation should be a bit more expressive
about the use and effects of each parameters, that would prevent easy
mistakes like mine.

By the way: the prefixes parameter isn't stated as optional in the
documentation but actually is.

Vianney Rancurel

unread,
Feb 8, 2011, 9:05:46 AM2/8/11
to scalit...@googlegroups.com
You may use the vdir interface: dpl_opendir(), dpl_readdir(), dpl_closedir() instead.
Using dpl_list_bucket() is too low level.

If you really need to use dpl_list_bucket(), you might read how dpl_opendir(), dpl_readdir()
are implemented with dpl_list_bucket().

Vianney

Hello,

--

www.scality.com
Vianney Rancurel
+33 1 7809 8270
+33 6 7737 9967


Reply all
Reply to author
Forward
0 new messages