Novell Home

TID101951 (inw001s) Long File Support on NetWare OS

From Developer Community

ABSTRACT:

Long File Support on NetWare OS

DETAILED DESCRIPTION

Question: How does an NLM make use of ANSI calls (open, fopen etc.) on files with long names?

There are 2 ways to do this.

The first way is to use NWSetNSInfo() to set the namespace.

But the current volume must be one that supports the long namespace, so you set the current working volume first.

Also, since multithreads share volumes at the thread group level, there can be confusion about the current working volume.

Then you must turn on case sensitivity. If you use this method, fopen will work, but for local files only. This approach does not support remote file handling.

Developer support recommends the second approach:

Use NWOpenNSEntry() which returns a file handle, which you can use with open(), write() etc. To use fopen(), fwrite() etc, use fdopen() to convert the file handle to a FILE * for use with fopen() etc.

The only drawback with this latter approach is that NWOpenNSEntry() requires authentication. If that's not possible, use NWDSLoginAsServer() to get around the problem.

Sample files to demonstrate this approach are available in a separate TID.


--devsup

Novell® Making IT Work As One

© 2008 Novell, Inc. All Rights Reserved.