construct

Constructs an ASCII path from the specified elements.

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

Syntax

  #include <fsio.h> 
   
  int construct (
     char   *path,
     char   *server,
     char   *volume,
     char   *directory,
     char   *name,
     char   *extension,
     int     flags);
  

Parameters

path

(OUT) Points to the constructed path. This buffer must be large enough to hold the elements specified in the rest of the arguments.

server

(IN) Points to the null-terminated name of the server. You can set it to NULL.

volume

(IN) Points to the null-terminated name of the volume. You can set it to NULL.

directory

(IN) Points to the null-terminated name of the directory. This string can contain more than one element. You can set it to NULL.

name

(IN) Points to the null-terminated name of the file. You can set it to NULL.

extension

(IN) Points to the null-terminated file extension. Set it to NULL if you are going to use a series of deconstruct/construct calls. The name parameter in deconstruct always includes the extension, if one exists. If the extension is not to be added redundantly to the pathname during reconstruction, extension must be passed as NULL.

flags

(IN) Specifies the type of delimiter to use between the elements of the path. Although you can OR any of the following flags together, you are responsible for selecting a combination that defines a known format.

Flag

Value

Description

PATH_UNDEF

0x00000000

Indicates a potential DOS path.

PATH_DOS

PATH_UNDEF

Indicates a potential DOS path.

PATH_UNC

0x00000001

Indicates a double slash at the beginning.

PATH_UNIX

0x00000002

Indicates only forward slashes used as delimiters.

PATH_NETWARE

0x00000004

Indicates a slash and colon followed by slashes.

PATH_MACINTOSH

0x00000008

Indicates only colons used as delimiters.

PATH_ROOTED

0x00000010

Starts with a delimiter.

PATH_ENDED

0x00000400

Indicates path ends in a delimiter.

PATH_DOSDRIVE

0x00001000

Indicates a single-letter drive, colon, and path.

Return Values

Always returns 0.

Remarks

The construct function accepts one or more null-terminated strings in code page 437 (8-bit ASCII) and concatenates these strings into a path according to what strings are filled in (what argument pointers are not passed as NULL) and to the flags specified in the type parameter. All parameters except path are optional and may be passed as NULL. The caller is responsible for ensuring that path can hold the resulting string.

The flags parameter can be set to PATH_UNDEF or set to a value that governs the directory delimiter to use and, to some extent, the layout of the string.

See Also

deconstruct