std-filename-split


Synopsis

(std-filename-split <fname>)

Description

std-filename-split splits all components of a partial or full pathname specifier into a list of its components:

1) the path, including a driveletter and colon,

2) the filename,

3) the extension including the dot.

There is no case conversion done. Supported platforms are Dos, Windows, Unix and OS/2.

Paths are processed with std-fpslash, but drive names only not. So there's no trailing slash forced with "<drive-letter>:" only.

The file does not need to exist actually, so there may arise problems with directories containing a dot and other ambiguities. It does not call findfile.

For details see below:

Examples

(std-filename-split "d:/acad")  => ("d:\\acad\\" "" "")
(std-filename-split "d:acad")  => ("d:" "acad" "")
(std-filename-split "d:/acad/test")  
=> ("d:\\acad\\" "test" "") (std-filename-split "d:/acad/test.lsp")
=> ("d:\\acad\\" "test" ".lsp") (std-filename-split "d:/acad/test.lsp/test.lsp")
=> ("d:\\acad\\test.lsp\\" "test" ".lsp")

Note

There exists an undocumented R14 AutoLISP function fnsplitl which is similar to std-filename-split.

Arguments

fname: a string. A partial or fully qualified filename specifier.

Return Value

A list of strings.

Side Effects

See std-fpslash.

Module

(std-require 'STDFILE)

Defined in STDFILE