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

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

NAME
strmaxcpy - copy at most a given number of characters of string SYNOPSIS
#include <publib.h> char *strmaxcpy(char *tgt, const char *src, size_t n); DESCRIPTION
strmaxcpy copies up to n-1 characters from the beginning of src to tgt, then adds a ''. n must be at least 1. The target string must be large enough to hold the result. Note that unlike strncpy(3), this function always terminates the result with ''. It also doesn't fill the result with extra '' charac- ters. RETURN VALUE
strmaxcpy returns its first argument. EXAMPLE
To print out the first 69 characters of a string, you might do the following (although familiarity with printf's format string might be more useful in this case). #include <stdio.h> #include <publib.h> void print42(const char *string) { char copy[43]; /* 42 + '' */ puts(strmaxcpy(copy, string, sizeof(copy))); } SEE ALSO
publib(3), strncpy(3) AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual STRMAXCPY(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