Sets the current working directory of the current thread to the specified path context.
#include <fsio.h> int setcwd2 ( NXPathctx_t pathCtx);
(IN) Specifies a path context.
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following errors:
You create a path context with the NXCreatePathContext function.
The setcwd2 function sets the current working directory for the current thread to a path context created with the NXCreatePathContext function. To set the current working directory for all threads on a VM to a path context, use setcwd.
The setcwd and setcwd2 functions allow you to inject an NKS path context with authenticated user credentials into the current working directory. Such credentials allow you to access resources:
On your current server (with a connection other than connection 0).
On remote servers.
To set up the current working directory so that you can access resources on a remote server:
Set up a path context to the remote server with NXCreatePathContext.
Set the current working directory to that path context with setcwd2.
You can then use POSIX and ANSI functions to access files on that remote server.