IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4638 for trunk/Nebulous/lib


Ignore:
Timestamp:
Jul 27, 2005, 5:48:41 PM (21 years ago)
Author:
jhoblitt
Message:

->open( $foo, 'write') is not allowed when object has multiple instances

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/lib/Nebulous/Client.pm

    r4633 r4638  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: Client.pm,v 1.17 2005-07-28 01:40:26 jhoblitt Exp $
     3# $Id: Client.pm,v 1.18 2005-07-28 03:48:41 jhoblitt Exp $
    44
    55package Nebulous::Client;
     
    161161    }
    162162
    163     my $fh  = $self->open( $key, 'write' );
     163    my $fh  = $self->open( $key, 'read' );
    164164    unless ( $fh ) {
    165165        $log->debug( "can't open $key" );
     
    435435
    436436    if ( $type eq 'write' ) {
     437        my $num_instances = scalar @$locations;
     438
     439        if ( $num_instances > 1 ) {
     440            $log->warn( "write not allowed with multiple instances" );
     441            $log->debug( "leaving" );
     442            return undef;
     443        }
     444
    437445        eval {
    438446            $fh = _get_filehandle( $path, '+<' );
Note: See TracChangeset for help on using the changeset viewer.