Charles.Forsyth20060303-partialeea662d19 years agoHistory
186 lines · 3.7 KB · Text
RawDownload
.TH WALK 5 .SH NAMEwalk \- descend a directory hierarchy.SH SYNOPSIS.ta \w'\fLTwalk 'u.IR size [4].B Twalk.IR tag [2].IR fid [4].IR newfid [4].IR nwname [2].IR nwname *( wname [ s ]).br.IR size [4].B Rwalk.IR tag [2].IR nwqid [2].IR nwqid *( qid [13]).SH DESCRIPTIONThe .B walkrequest carries as arguments an existing .IR fidand a proposed.I newfid(which must not be in use unless it is the same as.IR fid )that the client wishes to associate withthe result of traversing the directory hierarchyby `walking' the hierarchy using the successive path nameelements.BR wname .The.I fidmust represent a directory unless zero path name elements are specified..PPThe.I fidmust be valid in the current session and must not have been opened for I/Oby an.B openor.B createmessage.If the full sequence of.B nwnameelements is walked successfully,.I newfidwill represent the file that results.If not,.I newfid(and.BR fid )will be unaffected.However, if.I newfidis in use or otherwise illegal, an.B Rerroris returned..PPThe name.RB `` .. ''(dot-dot) represents the parent directory.The name.RB `` . ''(dot), meaning the current directory, is not used in the protocol..PPIt is legal for.B nwnameto be zero, in which case.I newfidwill represent the same file as.I fidand the.B walkwill usually succeed; this is equivalent to walking to dot.The rest of this discussion assumes.B nwnameis greater than zero..PPThe.B nwnamepath name elements.B wnameare walked in order, ``elementwise''.For the first elementwise walkto succeed, the file identified by.I fidmust be a directory,and the implied user of the request must have permissionto search the directory (see.IR intro (5)).Subsequent elementwise walks have equivalent restrictionsapplied to the implicit fid that results from the preceding elementwise walk..PPIf the first element cannot be walked for any reason,.B Rerroris returned.Otherwise, the walk will return an.B Rwalkmessage containing.I nwqidqids corresponding, in order, to the files that are visited by the.I nwqidsuccessful elementwise walks;.I nwqidis therefore either.B nwnameor the index of the first elementwise walk that failed.The value of.I nwqidcannot be zero unless.B nwnameis zero.Also,.I nwqidwill always be less than or equal to.BR nwname .Only if it is equal, however, will.I newfidbe affected, in which case.I newfidwill represent the filereached by the final elementwise walk requested in the message..PPA.B walkof the name.RB `` .. ''in the root directory of a server is equivalent to a walk with no name elements..PPIf.I newfidis the same as.IR fid ,the above discussion applies, with the obvious differencethat if the walk changes the state of.IR newfid ,it also changes the state of.IR fid ;and if.I newfidis unaffected, then.I fidis also unaffected..PPTo simplify the implementation of the servers, a maximum of sixteen name elements or qidsmay be packed in a single message.This constant is called.B MAXWELEMin.IR styx (2)and.IR styx (10.2).Despite this restriction, the system imposes no limit on the number of elements in a file name,only the number that may be transmitted in a single message..SH ENTRY POINTSA call to.IR chdir (2)causes a.BR walk .One or more.B walkmessages may be generated byany of the following calls, which evaluate file names:.BR bind ,.BR create ,.BR mount ,.BR open ,.BR remove ,.BR stat ,.BR unmount ,.BR wstat .The file name element.B .(dot) is interpreted locally andis not transmitted in.B walkmessages..SH SEE ALSO.IR sys-bind (2),.IR sys-chdir (2),.IR sys-open (2),.IR sys-remove (2),.IR sys-stat (2),.IR intro (5)