next up previous
Next: Saving and Restoring Multiple Objects
Up: Saving and Restoring Objects (Channels)
Previous: Writing Objects to a Channel

Reading Objects from a Channel  

Before discussing the format of the output produced above ([*]), let us consider how to read it back, so as to reconstruct the original Object. Naturally, we would first need to save the output in a file. On UNIX systems, we can do that simply by redirecting standard output to a file using a shell command like:

program1 >file

Within a subsequent program, we can read this Object back in by using the astRead function, having first created a suitable Channel:

object = astRead( channel );

By default, this function will read from the standard input stream (the default source for a basic Channel), so we would need to ensure that our second program reads its input from the file in which the Object description is stored. On UNIX systems, we could again use a shell redirection command such as:

program2 <file


next up previous
Next: Saving and Restoring Multiple Objects
Up: Saving and Restoring Objects (Channels)
Previous: Writing Objects to a Channel

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2003 Central Laboratory of the Research Councils