GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
FNPATHFIND(3) C Programmer's Manual FNPATHFIND(3)

fnpathfind - find a file in a list of directories

#include <publib.h>

int fnpathfind(const char *path, const char *tgt,
                     char *res, size_t max);

pathfind looks for a file in a list of directories. The argument `path' is a colon separated list of directories, typically the contents of an environment variable like PATH, MANPATH, or CDPATH. The function will go through the directories in the path and look in each directory for a file given in argument `target' until it finds it. Only an exact match is reported, no wild cards or globbing.

The names that are matched are formed by taking an element from the path and prepending it to target. An empty element means the current directory, as does the name ".".

The function returns -1 for failure (not found or error), or the total size for the full name (the full name may have been truncated when stored into result).

The function uses dynamic memory allocation and may therefore fail due to insufficient memory.

It is not trivial to know in which directory the search ended. This makes is difficult to continue the search.

publib(3), fname(3)

Lars Wirzenius (lars.wirzenius@helsinki.fi)
C Programmer's Manual Publib

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.