Provides an interface to the gass file module.
Allows the opening and closing of remote files using GASS to provide location
independence. The files can either be manipulated as python file objects, or
through the os module as file descriptors.
Methods
|
|
__del__
__init__
close
fclose
fopen
open
|
|
__del__
|
__del__ ( self )
Destroy an instance.
Deactivates the underlying module.
Raises:
A GassFileException is thrown if unable to deactivate the module.
|
|
__init__
|
__init__ ( self )
Constructs an instance.
Activates the underlying globus gass file module.
Raises:
A GassFileException is thrown if unable to initialize the module.
|
|
close
|
close ( self, fd )
Close the given file descriptor.
Similar to the unix close call, except it should only be used to close file
descriptors returned from the open method.
Arguments:
Raises:
A GassFileException is thrown if unable to close the file.
|
|
fclose
|
fclose ( self, file )
Close the give python file object.
Similar to the unix fclose call, except it should only be used to close a file
opened with the fopen method.
Arguments:
Raises:
A GassFileException is thrown if unable to close the file.
|
|
fopen
|
fopen (
self,
file,
mode,
)
Open the given file as a python file object.
Similar to the unix fopen call, except the file name should be a url.
Arguments:
file The gass url to be opened. Currently http, https, ftp, gsiftp
and local files are supported.
mode A string containing the mode to open the file in. The modes
are the same as the modes used in the unix fopen call.
Raises:
A GassFileException is thrown if unable to open the file.
Returns:
A python file object connected to the gass file is returned.
|
|
open
|
open (
self,
file,
oflags,
)
Open the given file.
Similar to the unix open call, except the filename argument should be a gass url.
Arguments:
file A url for the file to be open. Currently http, https, ftp, gsiftp are
supported.
flags The standard unix open flags. They're defined in the os module.
Raises:
A GassFileException is thrown if unable to open the url.
Returns:
An integer file descriptor suitable for use with the os module
is returned.
|
|