Charles.Forsyth20060303-partialeea662d19 years agoHistory
46 lines · 1.1 KB · Text
RawDownload
.TH FD2PATH 2.SH NAMEfd2path \- return file name associated with file descriptor.SH SYNOPSIS.EXinclude "sys.m";sys := load Sys Sys->PATH; fd2path(fd: ref FD): string;.EE.SH DESCRIPTIONAs described in.IR 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..B Fd2pathreturns the path name associated with open file descriptor.IR fd .(It returns nil if an error occurs.).PPChanges to the underlying name space do not update the path namestored with the file descriptor.Therefore,the path returned by.B fd2pathmay no longer refer to the same file (or indeed any file)after some component directory or file in the path has been removed, renamedor rebound..PPAs an example,.IR workdir (2)is implemented by opening.B .and executing.B fd2pathon the resulting file descriptor..SH SEE ALSO.IR bind (1),.IR ns (1),.IR sys-bind (2),.IR sys-intro (2),.IR workdir (2),.IR prog (3).SH DIAGNOSTICS.B Fd2pathreturns nil on error and sets the system error string.