A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.racket-lang.org/reference/More_Path_Utilities.html below:

15.1.2 More Path Utilities

15.1.2 More Path Utilities🔗ℹ

Returns the last element of

path

. If

path

is syntactically a directory path (see

split-path

), then the result is

#f

.

Returns a byte string that is the extension part of the filename in path, including the . separator. If the path has no extension, #f is returned.

See path-replace-extension for the definition of a filename extension.

Examples:

Added in version 6.5.0.3 of package base.

Determines whether the last element of path ends with ext but is not exactly the same as ext.

If ext is a byte string with the shape of an extension (i.e., starting with . and not including another .), this check is equivalent to checking whether (path-get-extension path) produces ext.

Examples:

Added in version 6.5.0.3 of package base.

Returns a byte string that is the extension part of the filename in path without the . separator. If path is syntactically a directory (see split-path) or if the path has no extension, #f is returned.

Finds a relative pathname with respect to

base

that names the same file or directory as

path

. Both

base

and

path

must be simplified in the sense of

simple-form-path

. If

path

shares no subpath in common with

base

,

path

is returned.

If more-than-root? is true, if base and path share only a Unix root in common, and if neither base nor path is just a root path, then path is returned.

If path is the same as base, then (build-path 'same) is returned only if more-than-same? is #f. Otherwise, and by default, path is returned when path is the same as base.

If normalize-case? is true (the default), then pairs of path elements to be compared are first converted via normal-case-path, which means that path elements are compared case-insentively on Windows. If normalize-case? is #f, then path elements and the path roots match only if they have the same case.

The result is normally a path in the sense of path?. The result is a string only if path is provided a string and also returned as the result.

Changed in version 6.8.0.3 of package base: Made path elements case-normalized for comparison by default, and added the #:normalize-case? argument.
Changed in version 6.90.0.21: Added the #:more-than-same? argument.

For most purposes, simple-form-path is the preferred mechanism to normalize a path, because it works for paths that include non-existent directory components, and it avoids unnecessarily expanding soft links.

Returns a complete version of path by making the path complete, expanding the complete path, and resolving all soft links (which requires consulting the filesystem). If path is relative, then wrt is used as the base path.

Letter case is not normalized by normalize-path. For this and other reasons, such as whether the path is syntactically a directory, the result of normalize-path is not suitable for comparisons that determine whether two paths refer to the same file or directory (i.e., the comparison may produce false negatives).

An error is signaled by normalize-path if the input path contains an embedded path for a non-existent directory, or if an infinite cycle of soft links is detected.

Example:

Returns

#t

if

path

is a

path element

: a path value for some platform (see

path-for-some-system?

) such that

split-path

applied to

path

would return

'relative

as its first result and a path as its second result. Otherwise, the result is

#f

.

Returns path without its final path element in the case that path is not syntactically a directory; if path has only a single, non-directory path element, #f is returned. If path is syntactically a directory, then path is returned unchanged (but as a path, if it was a string).

Examples:

Converts path to a string using a UTF-8 encoding of the path’s bytes.

Use this function when working with paths for a different system (whose encoding of pathnames might be unrelated to the current locale’s encoding) and when starting and ending with strings.

Converts str to a kind path using a UTF-8 encoding of the path’s bytes.

Use this function when working with paths for a different system (whose encoding of pathnames might be unrelated to the current locale’s encoding) and when starting and ending with strings.

Returns a suffix of pth that shares nothing in common with the suffixes of other-pths, or pth, if not possible (e.g. when other-pths is empty or contains only paths with the same elements as pth).

Examples:

#<path:list.rkt>

#<path:racket/list.rkt>


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4