Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fnpathfind(3pub) [debian man page]

FNPATHFIND(3pub)					       C Programmer's Manual						  FNPATHFIND(3pub)

NAME
fnpathfind - find a file in a list of directories SYNOPSIS
#include <publib.h> int fnpathfind(const char *path, const char *tgt, char *res, size_t max); DESCRIPTION
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 direc- tory 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). BUGS
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. SEE ALSO
publib(3), fname(3) AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual FNPATHFIND(3pub)

Check Out this Related Man Page

FNQUALIFY(3pub) 					       C Programmer's Manual						   FNQUALIFY(3pub)

NAME
fnqualify - qualify a filename SYNOPSIS
#include <publib.h> size_t fnqualify(char *result, const char *path, size_t max); DESCRIPTION
fname_qualify qualifies a filename. This means that if the input name is not an absolute name (i.e. starts from the root directory, e.g. is foo, not /tmp/foo), the current directory will be prepended to it. Also, tilde conversion is done: if the filename begins with a tilde (~), the tilde is replaced with the home directory of the user, and if it begins with a tilde and a username, both are replaced with the home directory of the given user. Simplifications like replacing /./ with /, and /foo/../bar with /bar are not done because of problems with symbolic links. RETURNS
The function returns -1 if there was some error, or the total size of the full name otherwise. The return value may be greater than the maximum size given by the last argument; only as much as allowed by that is actually written, though. SEE ALSO
publib(3), fname(3) AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual FNQUALIFY(3pub)
Man Page

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

searching for list of empty directories

Guys I need to write a korn shell script that will search for a list of empty sub-directories in a specific directory and then email a list of these empty directories. Any ideas - apologies, I am new to shell scripting. Thanks (4 Replies)
Discussion started by: man80
4 Replies

2. UNIX for Dummies Questions & Answers

Listing full file names with the exact length of 3 characters

This is what I have to do: Display the full file name (including the full path) and file size of all files whose name (excluding the path) is exactly 3 characters long. This is the code I have: find / -printf "Name: %f Path: %h Size: %s (bytes)\n" 2>/dev/null | grep -E "Name: .{3,} Path" |... (7 Replies)
Discussion started by: Joesgrrrl
7 Replies

3. Shell Programming and Scripting

Deleting empty directories using find

Hello, I'm submitting this thread, because I was looking a way to delete empty directories using find and I found a thread from 2007 that helped me. I have worked from that threat, but I found that the command sent would analyze original directory and may delete it to. I have come up with expanded... (3 Replies)
Discussion started by: lramirev
3 Replies

4. Shell Programming and Scripting

searching different multiple directories

Suppose I have 5 different directories in some path .Is it possible to search 5 different directories using find command in one single command line. I mean something like this:- find path -type d -name dirname1 dirname2 .......... pls help (2 Replies)
Discussion started by: maitree
2 Replies