|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
#include <dir.h> int fnsplit (const char *path, char *drive, char *dir, char *name, char *ext);
This function decomposes a path into its components. It is smart
enough to know that
.. are directories, and that
file names with a leading dot, like `.emacs', are not all extensions.
The drive, dir, name and ext arguments should
all be passed, but some or even all of them might be
Those of them which are non-
NULL should point to buffers which have
enough room for the strings they would hold. The constants
MAXEXT, defined on dir.h, define
the maximum length of these buffers.
See section fnmerge.
A flag that indicates which components were found:
The drive letter was found.
A directory or subdirectories was found.
A filename was found.
An extension was found.
The path included
char d[MAXDRIVE], p[MAXDIR], f[MAXFILE], e[MAXEXT]; int which = fnsplit("d:/djgpp/bin/gcc.exe", d, p, f, e); d = "d:" p = "/djgpp/bin/" f = "gcc" e = ".exe"
|webmaster donations bookstore||delorie software privacy|
|Copyright © 2004 by DJ Delorie||Updated Apr 2004|