set_pathname_format

Sets the name space for the pathname format of the calling thread.

Library:LibC
Classification:Novell
Service:File and Directory I/O

Syntax

  #include <fsio.h> 
   
  int set_pathname_format (
     int    newformat,
     int   *oldformat );
  

Parameters

newformat

(IN) Specifies the name space to use for path and file names and must be set to one of the following values to set the pathname format:

  • 0 SHORT_NAMES
  • 4 LONG_NAMES

If a value other than one of these is specified, the pathname format is not set, the results are undefined. The function might return EINVAL, and the oldformat parameter returns the current pathname format.

oldformat

(OUT) Specifies the pathname format before this function was called. For a list of possible values, see Section 20.2.7, Name Space Flags.

Return Values

If successful, returns 0.

Decimal

Constant

Description

9

EINVAL

The newformat parameter is invalid.

105

ENOCONTEXT

Either the thread context is invalid or not available for the operation.

Remarks

The function affects only the calling thread. Each thread in an NLM must call this for itself; the state is not inherited. No NKS functions are affected by the pathname format state (to set the NKS pathname format, see NXCreatePathContext.

The set_pathname_format function sets the format of any file or directory name or pathname returned by file system functions, which includes the following:

     stat, fstat, readdir, getcwd
  

The function does not affect file system hook function such as fs_mapkeytopath or fs_mapzidtopath.

The function sets the suggested format for all file or directory names or pathnames sent by file system functions including:

     access, open, sopen, fopen, fdopen, freopen, chdir, chdir2, 
     chmod, opendir, pipe, stat, mkdir, mkfifo, purgeerasedfile,
     salvageerasedfile, unlink, remove, rename, utime
  

The function does not affect temp file or directory functions, which are 8.3. These include the following:

     realname, fnmatch, mkstemp