Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
path(3m)		     MBA Library Functions		      path(3m)

NAME
       path - manipulate file path names

SYNOPSIS
       #include	<mba/path.h>

       int path_canon(const unsigned char *src,
		   const unsigned char *slim,
		   unsigned char *dst,
		   unsigned char *dlim,
		   int srcsep,
		   int dstsep);

DESCRIPTION
       The  path(3m)  module provides functions	for some common	path manipula-
       tions.

       canon  The path_canon function canonicalizes the	path at	src up to  but
	      not  including  the  memory at slim into the memory at dst up to
	      but not including	dlim.  The character that separates path  com-
	      ponents  in  the src path	is specified with the srcsep parameter
	      whereas dstsep specifies the separator with which	the  dst  path
	      is constructed.

	      Specifically,  canonicalization will eliminate '.' and '..' com-
	      ponents in paths in the conventional way as  well	 as  normalize
	      redundant	 separators. The presence or lack of an	initial	and/or
	      trailing separator is preserved. The following lists some	 exam-
	      ples of paths before and after canonicalization:

	      before	  after
	      /		  /
	      /.	  /
	      a/..
	      abc/../
	      a/b/c	  a/b/c
	      /a/b/c	  /a/b/c
	      /./a/b/c	  /a/b/c
	      /../a/b/c	  /a/b/c
	      a/b/c/	  a/b/c/
	      a/b/c/..	  a/b/
	      a/b/c/../	  a/b/
	      a/b/c/./	  a/b/c/

RETURNS
       canon  The  path_canon  function	returns	the number of bytes written to
	      dst not including	the zero terminator or -1 if slim or dlim  has
	      been reached in which case errno is set to ERANGE.

libmba-0.9.1			 Apr 29, 2005			      path(3m)

NAME | SYNOPSIS | DESCRIPTION | RETURNS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=path&manpath=FreeBSD+10.3-RELEASE+and+Ports>

home | help