*vital/System/Filepath.txt*		path string utilities library.

Maintainer: thinca  <thinca+vim@gmail.com>
            tyru    <tyru.exe@gmail.com>

==============================================================================
CONTENTS				*Vital.System.Filepath-contents*

INTRODUCTION			|Vital.System.Filepath-introduction|
INTERFACE			|Vital.System.Filepath-interface|
  Functions			  |Vital.System.Filepath-functions|

==============================================================================
INTRODUCTION				*Vital.System.Filepath-introduction*

*Vital.System.Filepath* is Path String Utilities Library.
It provides some functions to manipulate path strings.

==============================================================================
INTERFACE				*Vital.System.Filepath-interface*
------------------------------------------------------------------------------
FUNCTIONS				*Vital.System.Filepath-functions*

separator()			*Vital.System.Filepath.separator()*
	Return OS related directory separator as string.
	This returns "/" on non-Windows, or Windows and |'shellslash'| is on.
	This returns "\" on Windows and |'shellslash'| is off.

path_separator()		*Vital.System.Filepath.path_separator()*
	Return OS related path separator as string.
	This returns ";" on Windows.
	Otherwise this returns ":".

	You can get list of each filepath of $PATH by:
>
	split($PATH, s:F.path_separator())
<
path_extensions()		*Vital.System.Filepath.path_extensions()*
	Return OS related path extensions as array of string.

unify_separator({path})		*Vital.System.Filepath.unify_separator()*
	Return path string replaced all directory separators with '/'.

which({command} [, {path}])	*Vital.System.Filepath.which()*
	Returns the full path of {command}.  This searches from {path} or
	$PATH.  If the command is not found, returns empty string.

split({path})			*Vital.System.Filepath.split()*
	Return |List| of elements in {path} string.

join({args}...)			*Vital.System.Filepath.join()*
	Join the path in {args}.

is_absolute({path})		*Vital.System.Filepath.is_absolute()*
	When {path} is absolute path, return 1.
	Otherwise, return 0.
	cf. |Vital.System.Filepath.is_relative()|

is_relative({path})		*Vital.System.Filepath.is_relative()*
	When {path} is relative path, return 1.
	Otherwise, return 0.
	cf. |Vital.System.Filepath.is_absolute()|

dirname({path})			*Vital.System.Filepath.dirname()*
	Return directory name from {path}.

basename({path})		*Vital.System.Filepath.basename()*
	Return basename from {path}.

remove_last_separator({path})	*Vital.System.Filepath.remove_last_separator()*
	Remove last directory separator if exists.

is_case_tolerant()		*Vital.System.Filepath.is_case_tolerant()*
	Return non-zero if filesystem ignores alphabetic case of a filename,
	zero otherwise.

abspath({path})			*Vital.System.Filepath.abspath()*
	Return an absolute path of {path}.
	If the {path} is already an absolute path, it return the {path}.
	cf. |Vital.System.Filepath.relpath()|

relpath({path})			*Vital.System.Filepath.relpath()*
	Return an relative path of {path}.
	If the {path} is already a relative path, it return the {path}.
	cf. |Vital.System.Filepath.abspath()|

unixpath({path})		*Vital.System.Filepath.unixpath()*
	Return an unix path of {path}.
	All backslashes (\) in {path} will be substituted to slashes (/).

winpath({path})			*Vital.System.Filepath.winpath()*
	Return a windows path of {path}.
	All slashes (/) in {path} will be substituted to backslashes (\).

realpath({path})		*Vital.System.Filepath.realpath()*
	Return a real path of {path} of the current operation system.
	In non Windows OS, it call |Vital.System.Filepath.unixpath()|
	internally.
	In windows, it call |Vital.System.Filepath.unixpath()| when the
	Vim is compiled with '+shellslash' and |shellslash| is specified.
	Otherwise it call |Vim.System.Filepath.winpath()| internally.

is_root_directory({path})	*Vital.System.Filepath.is_root_directory()*
	Return 1 if the given {path} points to the root directory, otherwise
	0.
>
	is_root_directory('/') == 1
	is_root_directory('/aaa') == 0
	is_root_directory('/aaa/..') == 0 " It doesn't resolve.
	is_root_directory('C:/') == 1     " If it's on Windows.
<
contains({path}, {base})	*Vital.System.Filepath.contains()*
	Return 1 if {path} contains {base}, otherwise 0.
	{path} and {base} must be a full path.
>
	contains('/foo/bar/buz', '/foo/bar') == 1
	contains('/foo/hoge/buz', '/foo/bar') == 0
<


==============================================================================
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl
