| www.delorie.com/djgpp/doc/libc-2.01/libc_282.html | search |
#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 . and .. are directories.
The drive, dir, name and ext arguments should
all be passed, but some or even all of them might be NULL pointers.
Those of them which are non-NULL should point to buffers which have
enough room for the strings they would hold. The constants MAXDRIVE,
MAXDIR, MAXFILE and MAXEXT, defined on dir.h, define
the maximum length of these buffers.
See section fnmerge.
A flag that indicates which components were found:
DRIVE
DIRECTORY
FILENAME
EXTENSION
WILDCARDS
* or ?.
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"
Go to the first, previous, next, last section, table of contents.
| prev next webmaster | delorie software privacy |
| Copyright © 1997 | Updated Apr 1997 |