BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kfopen - open a data transport stream

LIBRARY CALL

kfile *kfopen(
   const char *path,
   const char *type)

INPUT

OUTPUT

none

RETURN VALUE

The kfile pointer representing the open stream to the data transport on success, NULL on failure

DESCRIPTION

This function is a replacement for the system "fopen" call; kfopen() supports the opening of any khoros data transport mechanism.

Identifiers for Khoros data transport mechanisms include the following: 'file' (standard Unix file; local transport / permanent storage) 'pipe' (standard pipes; local transport / no permanent storage) 'mmap' (virtual memory; local transport / permanent storage) 'shm' (shared memory; local transport / permanent storage) 'socket' (sockets; local or remote transport / no permanent storage) 'stream' (named streams/pipes; local transport / no permanent storage)

The token is the type of identifier for that transport. For a file, it is simply the filename. For shared memory, it is the shared memory key. For a pipe, it is the input & output file descriptors, as in "pipe=[3,4]". For a socket, it is the number of the socket, as in "socket=5430".

Together, the identifier and the token identify the path to the data transport to be opened. The path must be in the form of an identifier and a token, separated by an "=" equal indicator, as in: "{identifier}={transport token}"

For example, the path parameter for opening shared memory might be: "shm=1032" The path parameter for opening a file might be: "file=/usr/tmp/vadd1235" When opening a file as the data transport mechanism, the identifier and the "=" sign may be omitted, as in: "./foobar"

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$BOOTSTRAP/objects/library/kutils/src/kstdio.c

SEE ALSO

kutils(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.