Charles.Forsyth20061220965a0ca19 years agoHistory
88 lines · 1.8 KB · Text
RawDownload
.TH FSPROTO 2.SH NAMEFSproto: readprotofile, readprotostring \- read file system prototype file.SH SYNOPSIS.EXinclude "fsproto.m";fsproto := load FSproto FSproto->PATH; Direntry: type (string, string, ref Sys->Dir); init:   fn(): string; readprotofile: fn(proto: string, root: string,        entries: chan of Direntry,        warnings: chan of (string, string)): string; readprotostring: fn(proto: string, root: string,        entries: chan of Direntry,        warnings: chan of (string, string));.EE.SH DESCRIPTION.B FSprotoprovides an interface to read a file system prototype file,as defined by.IR proto (6)..PP.B Initmust be called before any other function in the module..PP.B Readprotofilereads a file system prototype from the file.IR proto .It traverses the file system, starting at the given.IR root ,and each file or directory encountered that is mentionedin the prototype causes.B readprotofileto send a.B Direntrytuple on the channel.IR entries .The tuple has the form.BI ( old , new , dir\fP\f5)\fPwhere.I oldis the name of the current file or directory,rooted at.IR root ,.I newis the same file's name.I relativeto.IR root ,and.I diris a reference to the.B Sys->Dirdirectory information for.IR old ,as produced by.IR sys-stat (2).When all files in.I roothave been examined,.B readprotofilesends a single tuple with all nil components on.IR entries .For each error that occurs during processing (eg, unable to open a directory).B readprotofilesends a tuple.BI ( old , diag )on the channel.IR warnings ,naming the file and giving a diagnostic string,but processing continues..PP.B Readprotostringreads a file system prototype from the string.I protoitself.Otherwise, its operation is the same as.BR readprotofile ..SH SOURCE.B /appl/lib/fsproto.b.SH SEE ALSO.IR fs (1),.IR proto (6),.IR mkfs (8)