The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

pathfind (3)
  • >> pathfind (3) ( Solaris man: Библиотечные вызовы )
  •  

    NAME

    pathfind - search for named file in named directories
     
    

    SYNOPSIS

    cc [ flag ... ] file ... -lgen [ library ... ]
    #include <libgen.h>
    
    char *pathfind(const char *path, const char *name, const char *mode);
    

     

    DESCRIPTION

    The pathfind() function searches the directories named in path for the file name. The directories named in path are separated by colons (:). The mode argument is a string of option letters chosen from the set [rwxfbcdpugks]:

    LetterMeaning

    rreadable

    w

    x

    f

    b

    c

    d

    p

    u

    g

    k

    s

    Options read, write, and execute are checked relative to the real (not the effective) user ID and group ID of the current process.

    If name begins with a slash, it is treated as an absolute path name, and path is ignored.

    An empty path member is treated as the current directory. A slash (/) character is not prepended at the occurrence of the first match; rather, the unadorned name is returned.  

    EXAMPLES

    Example 1 Example of finding the ls command using the PATH environment variable.

    To find the ls command using the PATH environment variable:

    pathfind (getenv ("PATH"), "ls", "rx")

     

    RETURN VALUES

    The pathfind() function returns a (char *) value containing static, thread-specific data that will be overwritten upon the next call from the same thread.

    If the file name with all characteristics specified by mode is found in any of the directories specified by path, then pathfind() returns a pointer to a string containing the member of path, followed by a slash character (/), followed by name.

    If no match is found, pathname() returns a null pointer, ((char *) 0).  

    ATTRIBUTES

    See attributes(5) for descriptions of the following attributes:

    ATTRIBUTE TYPEATTRIBUTE VALUE

    MT-LevelMT-Safe

     

    SEE ALSO

    sh(1), test(1), access(2), mknod(2), stat(2), getenv(3C), attributes(5)  

    NOTES

    The string pointed to by the returned pointer is stored in an area that is reused on subsequent calls to pathfind(). The string should not be deallocated by the caller.

    When compiling multithreaded applications, the _REENTRANT flag must be defined on the compile line. This flag should only be used in multithreadedapplications.


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    EXAMPLES
    RETURN VALUES
    ATTRIBUTES
    SEE ALSO
    NOTES


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру