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

FreeBSD Manual Pages

  
 
  

home | help
SHTK_FS_NORMALIZE_PATH(3)   Library Functions Manual SHTK_FS_NORMALIZE_PATH(3)

NAME
       shtk_fs_normalize_path -- Returns a normalized form of a	path

LIBRARY
       shtk_import fs

SYNOPSIS
       shtk_fs_normalize_path path

DESCRIPTION
       The shtk_fs_normalize_path function takes the given path	and prints its
       normalized form to stdout.

       This process involves the following:

          Collapsing multiple consecutive forward slashes into	one.

          Adding  a  .	 component at the beginning of the path	if it is rela-
	   tive.

          Removing any	. components, except for the first one.

          Removing any	trailing slashes.

       Note that the normalization happens without performing any file	system
       operations.   Therefore,	 it  is	 perfectly possible for	two normalized
       paths that look different to point to the same file system  entry.   In
       particular,  this  is  because normalization does not take into account
       links nor .. components.

RETURN VALUES
       shtk_fs_normalize_path returns 0.

EXAMPLES
	     shtk_fs_normalize_path /foo/bar  #	Prints /foo/bar
	     shtk_fs_normalize_path foo/bar  # Prints ./foo/bar
	     shtk_fs_normalize_path foo///bar/./baz//  # Prints	./foo/bar/baz

SEE ALSO
       shtk(3),	shtk_fs(3)

HISTORY
       shtk_fs_normalize_path first appeared in	shtk 1.7.

FreeBSD	Ports 14.quarterly    September	18, 2016     SHTK_FS_NORMALIZE_PATH(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=shtk_fs_normalize_path&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help