~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to s3tools/src/s3stat.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright (C) 2010- The University of Notre Dame
 
3
This software is distributed under the GNU General Public License.
 
4
See the file COPYING for details.
 
5
*/
 
6
#include <stdio.h>
 
7
#include <stdlib.h>
 
8
#include <string.h>
 
9
#include <stringtools.h>
 
10
 
 
11
#include "s3common.h"
 
12
#include "s3c_file.h"
 
13
 
 
14
int main(int argc, char** argv) {
 
15
        struct s3_dirent_object d;
 
16
        char remotename[FILENAME_MAX];
 
17
 
 
18
        s3_initialize(&argc, argv);
 
19
 
 
20
        if(argc < 3) {
 
21
                fprintf(stderr, "usage: s3get <filename> <bucket>\n");
 
22
                return -1;
 
23
        }
 
24
        sprintf(remotename, "/%s", string_basename(argv[1]));
 
25
 
 
26
        s3_stat_file(remotename, argv[2], &d, s3_userid(), s3_key());
 
27
 
 
28
        return 0;
 
29
}
 
30