FilePath.this

Create a FilePath from a copy of the provided string.

FilePath assumes both path & name are present, and therefore may split what is otherwise a logically valid path. That is, the 'name' of a file is typically the path segment following a rightmost path-separator. The intent is to treat files and directories in the same manner; as a name with an optional ancestral structure. It is possible to bias the interpretation by adding a trailing path-separator to the argument. Doing so will result in an empty name attribute.

With regard to the filepath copy, we found the common case to be an explicit .dup, whereas aliasing appeared to be rare by comparison. We also noted a large proportion interacting with C-oriented OS calls, implying the postfix of a null terminator. Thus, FilePath combines both as a single operation.

Note that Win32 '\' characters are normalized to '/' instead.

class FilePath
this
(
cstring filepath = null
)

Meta