path

Documentation for the simul_efun-path api in /secure/simul_efun/path.c.

Functions

string cannonical_form(mixed fname)

Change object path names to standard form, stripping the trailing .c, if any, the clone number, if any, and making sure the leading / exists.

This function is useful for making sure that alternate forms of the pathname match correctly, since: cannonical_form(“foo/bar”) == cannonical_form(“/foo/bar.c”)

int path_exists(string x)

Returns true if the path exists, false otherwise.

int is_directory(string x)

Returns true if the path is a directory, false otherwise.

int is_file(string x)

Returns true if the path is a file, false otherwise.

string *split_path(string p)

Given a path, returns an array of two strings, the first being the directory part of the path, and the second being the file part.

string base_path(string p)

Given a path, returns the directory part of the path.

string depath(string p)

Given a path, returns the file part of the path.

varargs void walk_dir(string path, function func, mixed arg)

Walks a directory tree, calling a function for each directory it finds.

string canonical_path(string path)

Strip out all “.” and “..” forms from a path. Remove double slashes. Ensure the path has a leading slash.

string join_path(string dir, string file)

Given a directory and a file, return the full path.

mapping map_paths(mixed paths)

Given an array of paths, return a mapping of the form ([dir: ({files})]).

varargs string absolute_path(string relative_path, mixed relative_to)

Given a relative path and an object, return the absolute path.

nomask string wiz_dir(mixed what)

Given a wizard name or object, return the wizard’s directory.

File generated by Lima 1.1a4 reStructured Text daemon.