#!/usr/bin/perl

use strict;
use warnings;

use lib "./lib";

use PS::IPP::IData::Client; # trace => 'debug';

my $idata = PS::IPP::IData::Client->new(
    proxy   => 'http://localhost:80/idata'
);

my $fname = shift;

#my $fh = $idata->create( $fname );
#$idata->unlock( $fname, 'write' );

$idata->create( $fname, 1 );
$idata->unlock( $fname, 'write' );
$idata->delete( $fname );

__END__

{
    my $fh = $pd->create( $key );
    die "can't create file $fname" unless $fh;
    print $fh "fooby\n";
    close $fh;
    #$idata->unlock( $fname, 'write' );
    my $filesize =  (stat( $key ))[7];
    print "created file $key, ${filesize}bytes\n";
}
