IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 10, 2009, 4:17:26 PM (17 years ago)
Author:
jhoblitt
Message:

add --xattr flag to dsget

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/scripts/dsget

    r19742 r24374  
    11#!/usr/bin/env perl
    22
    3 # Copyright (C) 2006-2008  Joshua Hoblitt
    4 #
    5 # $Id: dsget,v 1.35 2008-09-24 21:58:03 jhoblitt Exp $
     3# Copyright (C) 2006-2009  Joshua Hoblitt
    64
    75use strict;
     
    97
    108use vars qw( $VERSION );
    11 $VERSION = '0.02';
     9$VERSION = '0.03';
    1210
    1311use DataStore;
     
    2826    $server,
    2927    $compress,
    30     $timeout
     28    $timeout,
     29    @xattrs,
    3130);
    3231
     
    4342    'filename|f=s'  => \$filename,
    4443    'compress|c'    => \$compress,
    45     'timeout|t=s'     => \$timeout,
     44    'timeout|t=s'   => \$timeout,
     45    'xattr|x=s'     => \@xattrs,
    4646) or pod2usage( 2 );
    4747
     
    159159    require Nebulous::Client;
    160160    import Nebulous::Client;
     161    require Nebulous::Util;
     162    import Nebulous::Util qw( :standard );
    161163    require File::Copy;
    162164    import File::Copy;
     
    188190        or die "Nebulous can't set xattr on key $filename";
    189191
     192    if (scalar @xattrs) {
     193        write_xattrs($neb, $filename, @xattrs)
     194            or die "Nebulous set xattrs on key $filename";
     195    }
     196
    190197    open(my $src_fh, $tmpfilename) or die "can't open file $tmpfilename: $!";
    191198
     
    230237
    231238    dsget --uri <uri> --filename <filename> [--bytes <nbytes>] [--md5 <hex>]
    232         [--compress] [--nebulous] [--volume <volume name>] [--copies <n>]
     239        [--compress] [--nebulous] [--xattr user.<name>:<value>]
     240        [--volume <volume name>] [--copies <n>]
    233241
    234242=head1 DESCRIPTION
     
    265273Optional.
    266274
     275=item * --xattr|-x
     276
     277Flag to set a Nebulous xattr on C<--filename>.  Can be specified more than
     278once.
     279
     280Optional.
     281
    267282=item * --compress|-c
    268283
     
    306321=head1 COPYRIGHT
    307322
    308 Copyright (C) 2006-2008  Joshua Hoblitt.  All rights reserved.
     323Copyright (C) 2006-2009  Joshua Hoblitt.  All rights reserved.
    309324
    310325This program is free software; you can redistribute it and/or modify it under
Note: See TracChangeset for help on using the changeset viewer.