3 # This file is part of Stem.
4 # Copyright (C) 1999, 2000, 2001 Stem Systems, Inc.
6 # Stem is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # Stem is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Stem; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # For a license to use the Stem under conditions other than those
21 # described here, to purchase support for this software, or to purchase a
22 # commercial warranty contract, please contact Stem Systems at:
24 # Stem Systems, Inc. 781-643-7504
25 # 79 Everett St. info@stemsystems.com
39 This is just the path to the file. Given Unix conventions, the path
40 may include the full file name from the root. It's required.
48 Can be read (default), write, or read/write. Indicates how the file
49 is to be opened using Unix conventions.
58 my( $class ) = shift ;
60 my $self = Stem::Class::parse_args( $attr_spec, @_ ) ;
61 return $self unless ref $self ;
69 my( $self, $msg ) = @_ ;
71 my $type = $msg->type() ;
73 #print $msg->dump( 'switch' ) ;
75 if ( $type eq 'cmd' ) {
77 $self->cmd_in( $msg ) ;
85 my( $self, $read_size_wanted ) = @_ ;
92 my( $self, $read_size_wanted ) = @_ ;
94 $self->{'handle'}->readline() ;
99 my( $self, $write_data ) = @_ ;
101 $self->{'handle'}->write( $write_data ) ;
108 $self->{'handle'}->close() ;
110 delete( $self->{'handle'} ) ;