TutGetSocketDir get name of directory where local socket files are written
None
String containing directory name.
None
TutGetSocketDir returns the directory name where all SmartSockets local sockets are located. For Windows systems, this does not apply. On UNIX, this is usually the directory /tmp/rtworks
. On OpenVMS, this is usually the directory RTSOCKETS: [SOCKETS.
node
]
where node
is the node name of the computer.
TutGetSocketDir also uses mkdir
to create the directory if it does not already exist.
When running SmartSockets, it is often necessary to create files (such as UNIX domain sockets) that are world-readable and world-writable. To avoid forcing users to create world-writable directories under their own home directory, TutGetSocketDir is used instead.
The string returned by TutGetSocketDir points into an internal data structure and should not be modified.
See the TIBCO SmartSockets Application Programming Interface reference for information on TipcConnCreateServerLocal and TipcConnCreateClientLocal.
This example opens a file with the specified name in the directory returned by TutGetSocketDir:
FILE *open_ipc_log_file(name)
T_STR name;
{
T_STRING file_name;
#ifdef T_OS_VMS
sprintf(file_name, "%s%s", TutGetSocketDir(), name);
#else
sprintf(file_name, "%s/%s", TutGetSocketDir(), name);
#endif
return TutFOpen(file_name, "w");
} /* open_ipc_log_file */
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |