Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>fnsplit</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
fnsplit
=======

Syntax
------

     #include <dir.h>
     
     int fnsplit (const char *path, char *drive, char *dir,
                   char *name, char *ext);

Description
-----------

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.

fnmerge:.   

Return Value
------------

A flag that indicates which components were found:

`DRIVE'
     The drive letter was found.

`DIRECTORY'
     A directory or subdirectories was found.

`FILENAME'
     A filename was found.

`EXTENSION'
     An extension was found.

`WILDCARDS'
     The path included `*' or `?'.

Example
-------

     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"


See Also: fnmerge

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson