Novell is now a part of Micro Focus

Is it possible in a NetWare thread to...

Articles and Tips: qna

01 Feb 2002


Q.

Is it possible in a NetWare thread to implement multiple CWDs (Current Working Directories)? I would like to set up a few different CWDs in a single ThreadGroup that I can activate as simply as setting the current screen.

A.

We do have an answer if what you are looking for functions like the following:

CreateCWD( char const* path);
DestroyCWD( int CWDhandle);
GetCurrentCWD( void);
GetCurrentCWD( int CWDhandle);

These, unfortunately, do not exist. However, you can use getcwd() and chdir() (or their FE equivalents) to get and set the current working directory of the current thread group. If these will not work then you will need to implement your own functions.

It should not be very hard to implement these and other functions. The call CreateCWD can, for example, just make a copy of the parameter, which you can add to a dynamic array and return the index of the new element. the call DestroyCWD should remove the string from the array treating CWDhandle as an index.

The call GetCurrentCWD should read the current CWD with getcwd, look it up in the array and add it to the array if it is not there. The SetCurrentCWD call should find the desired string in the array and pass it to chdir.

If you need any specific help in doing this, contact Novell Developer Support at http://developer.novell.com.

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates