FD2PATH man page on Plan9

Printed from http://www.polarhome.com/service/man/?qf=FD2PATH&af=0&tf=2&of=Plan9

FD2PATH(2)							    FD2PATH(2)

NAME
       fd2path - return file name associated with file descriptor

SYNOPSIS
       #include <u.h>
       #include <libc.h>

       int fd2path(int fd, char *buf, int nbuf)

DESCRIPTION
       As  described  in  intro(2),  the kernel stores a rooted path name with
       every open file or directory; typically, it is the  name	 used  in  the
       original	 access of the file.  Fd2path returns the path name associated
       with open file descriptor fd.  Up to nbuf bytes of the name are	stored
       in  buf;	 if  the  name is too long, it will be silently truncated at a
       UTF-8 character boundary.  The name  is	always	null-terminated.   The
       return value of fd2path will be zero unless an error occurs.

       Changes to the underlying name space do not update the path name stored
       with the file descriptor.  Therefore, the path returned by fd2path  may
       no longer refer to the same file (or indeed any file) after some compo‐
       nent directory or file  in  the	path  has  been	 removed,  renamed  or
       rebound.

       As  an  example,	 getwd(2)  is  implemented by opening .	 and executing
       fd2path on the resulting file descriptor.

SOURCE
       /sys/src/libc/9syscall

SEE ALSO
       bind(1), ns(1), bind(2), intro(2), getwd(2), proc(3)

DIAGNOSTICS
       Sets errstr.

								    FD2PATH(2)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net