10.0;itest (IOS test), revision 1.0, 88/04/22
ios_test - test ios_$ calls
usage: ios_test [-init]
DESCRIPTION
iostest is a program for testing type managers that manage input and
output to objects. iostest allows you to open a stream to any type of
object and then use selected IOS calls on the open stream. With
iostest, you can open streams to existing or new objects. For more
information on using iostest to test type managers, see Using the
Open System Toolkit to Extend the Streams Facility.
OPTIONS
-init
Call the ios$initialize routine (within a type manager) at start-up
time.
COMMANDS SUMMARY
iostest prompts for commands. Any valid, unambiguous prefix of one of
the following commands will suffice. Each command calls the IOS
call with a similar name. For example, the close command calls
ios$close.
Syntax Function
changepathname stream-id pathname
Changes the pathname of an object.
close stream-id Closes a stream.
create create-mode [open-options] pathname typename
Creates an object and opens a stream to it.
delete stream-id Deletes an object and closes the associated
stream.
dup stream-id stream-id Creates a copy of a specified stream ID.
equal stream-id-1 stream-id-2
Determines whether two stream IDs refer to the
same object.
export stream-id Simulates stream passing via a pgm$invoke
system call. This command tests a type manager's
export and import procedures.
forcewrite stream-id Forcibly writes an object and the directory
containing the object to stable storage.
get [put-get-option] stream-id count
Copies data from a stream into a buffer.
inqbytepos [pos-opt] stream-id
Returns the byte position of the stream marker.
If you omit a position option, the default is
the current position of the stream marker.
inqconnflags stream-id
Displays the current "on" (true) connection
flags for a connection.
inqcurreclen stream-id
Returns the length of the record at the current
stream marker.
inqfileattr stream-id Returns object usage attributes.
inqflags stream-id Returns the attribute set of an object's type
manager.
inqfullkey [pos-opt] stream-id
Returns a full seek key. If you omit a position
option, the default is the current position of
the stream marker.
inqobjflags stream-id Displays the current "on" (true) object flags
for an object.
inqpathname [name-type] stream-id
Returns the pathname of the object to which a
stream is open. If you omit a name-type, the
default is -root.
inqrecpos [pos-opt] stream-id
Returns the record position of the stream
marker. If you omit a position option, the
default is the current position of the stream
marker.
inqrecrem stream-id Returns the number of bytes remaining in the
current record.
inqrectype stream-id Returns the record type of an object.
inqshortkey [pos-opt] stream-id
Returns a short seek key. If you omit a position
option, the default is the current position of
the stream marker.
inqtypeuid stream-id Returns the type UID of an object.
locate stream-id count Reads data from a stream, returning a pointer to
the data (rather than copying the data to a
buffer).
open [open-options] pathname
Opens a stream to an existing object.
put [put-get-options] [-nl] stream-id string
Writes data into an object. The -nl option
inserts a newline character at the end of the
string, the default writes only the data.
readdir stream-id maxcnt bufsize
Reads up to maxcnt dir entries or so long as
there is space in bufsize (or EOF is reached).
replicate stream-id stream-id
Creates a copy of a specified stream ID.
rewinddir stream-id Rewinds dir stream-id to beginning-of-file
(BOF).
seek [-relative [-minus]] [-record] stream-id count
Performs an absolute or relative seek using byte
or record positioning. If you omit the -relative
option, the default is an absolute seek. If you
omit the -minus option, the default is to seek
forward, towards the end of the file. If you
omit the -record option, the default is to seek
by bytes.
seekdir stream-id key Positions to key within dir stream-id (key must
be returned by telldir)
seekfull stream-id recadr byteadr
Performs a seek using a full (8-byte) seek key.
seekshort stream-id key Performs a seek using a short 4-byte seek key.
seektobof stream-id Positions the stream marker to the beginning of
an object.
seektoeof stream-id Positions the stream marker to the end of an
object.
setconnflag stream-id connection-flag [t | f]
Sets a connection flag to be on (true) or off
(false). "connection-flag" can be one of:
"tty", "ipc", "vt", "write", "append",
"unregulated", or "read_intend_writ".
setobjflag stream-id object-flag [t | f]
Sets an object flag to be on (true) or off
(false). "object-flag" can be one of: "delete",
"spare", "ascii", "ftncc", or "cond".
setrectype stream-id rec-type rec-len
Sets an object's record type and length. "rec-
type" can be one of: "v1", "f2", "undef",
"exf2", or "f1". "rec-len" is the integer
record length.
switch stream-id stream-id
Switches a stream from one stream ID to another
stream ID.
telldir stream-id Returns a key that refers to current position in
dir stream-id
truncate stream-id Deletes the contents of an object following the
current stream marker.
Use one of the following to specify create-mode. These options
correspond to the ios$createmodet data type.
-nopreexist Returns an error if object already exists.
-preserve Saves contents of object, if it exists, opens
object, and positions stream marker at BOF.
-recreate Deletes existing object and creates new one of
the same name.
-truncate Opens object, then truncates the contents.
-makebackup Creates a backup (.bak) file when closed.
-locnameonly Creates a temporary unnamed object, uses
pathname to specify location of object, and
locates it on the same volume.
Use one of the following to specify name-type. These options correspond
to the ios$nametypet data type.
-leaf Specifies leaf name regardless of object's name.
-ndir Specifies leaf name if object's name is a name
in current naming directory; otherwise,
specifies full pathname.
-node Specifies name relative to the root directory if
object is a name in boot volume; otherwise,
specifies full pathname.
-nodedata Specifies leaf name if object's name is a name
in current nodedata directory; otherwise,
specifies full pathname.
-root Specifies full pathname, for example,
//node/sid/file.
-wdir Specifies leaf name if object's name is a name
in current working directory; otherwise,
specifies full pathname.
Use one or more of the following to specify open-options. These options
correspond to the ios$openoptionst data type.
-nod[elay] ios$open does not wait for the open to complete
before returning.
-w[rite] Permits writing data to a new object.
-unreg[ulated] Permits concurrent writing (unregulated read and
write access) to the object.
-positiontoeof Positions stream marker at EOF at open.
-inq[uireonly] Opens object for attribute inquiries only.
Use one of the following to specify pos-opt. These options correspond to
the ios$posoptt data type.
-bof Returns key for EOF marker.
-eof Returns key for BOF marker.
Use one or more of the following to specify put-get-options. These
options correspond to the ios$putgetoptst data type.
-cond Gets or puts data conditionally. If the data is
not available, returns with a status indicating
that condition.
-pre[view] Determines if a put/get would succeed, but does
not actually perform data transfer.
-part[ialrecord] Puts the data, but does not terminate the
record.
-norec[bndry] Ignore record (line) boundaries.
DEBUGGING MANAGERS
Under normal conditions, user-written managers are dynamically loaded
into the opener's address space. While you can use iostest to test such
managers, the manager code itself can not be debugged using debug at the
present time.
To debug managers using iostest, you must follow the convention that
your manager contains no "main program" (PROGRAM in Pascal, "main" in C).
Instead, the initialization for your manager (the part that calls
trait$mgrdcl, etc.) should be placed in a procedure named
"ios$initialize". To debug your manager module using iostest, bind all
the pieces of your manager together with /com/iostest. Then use debug
on the result of the bind and give the -init option. For example
$ bind -b myitest <<!
my_mgr.bin
my_mgr_uid.bin
/sys/traits/io_traits
/com/itest
!
$ debug -src myitest -init