Package pyGlobus :: Module io :: Class GSIFile
[show private | hide private]
[frames | no frames]

Class GSIFile

Known Subclasses:
GSIInfile, GSIOutfile

This is a file-like class that wraps a GSITCPSocket.
Method Summary
  __init__(self, sock, mode)
Initialize a GSIFile class.
  __del__(self)
Close the socket if it is still open
  close(self)
Close the associated socket.
  flush(self)
In theory, flush any pending output.
  read(self, size, waitForBytes)
Read size bytes, returning a string.
  readline(self)
Read a line, and return it.
  shutdown(self, n)
Shutdown the associated socket.
  write(self, str)
Write a string to the socket.

Method Details

__init__(self, sock, mode)
(Constructor)

Initialize a GSIFile class. the sock argument should be a GSITCPSocket. The mode argument is interpreted as for a file object, except that only 'r' and 'w' are meaningful.

__del__(self)
(Destructor)

Close the socket if it is still open

close(self)

Close the associated socket.

flush(self)

In theory, flush any pending output. In practice, this does nothing.

read(self, size=0, waitForBytes=-1)

Read size bytes, returning a string.
Parameters:
size - - The number of bytes that you wish to read in.
waitForBytes - - the minimum number of bytes that will be read in before returning, if unspecified it will default to size
Returns:

A string is returned

None. This method doesn't raise any exceptions but the socket object could raise one.

readline(self)

Read a line, and return it.

shutdown(self, n)

Shutdown the associated socket.

write(self, str)

Write a string to the socket.

Generated by Epydoc 2.1 on Tue Apr 4 14:32:55 2006 http://epydoc.sf.net