forsyth20121205-174063a80cc13 years agoHistory
63 lines · 1.3 KB · Text
RawDownload
.TH RAMFILE 4.SH NAMEramfile \- synthesise file.SH SYNOPSIS.B ramfile.I file[.I data].SH DESCRIPTION.I Ramfileputs a virtual file in the name space at.IR file ,and services file requests on it.Data written to the file is stored in.IR ramfile 'smemory; read requests return the previously stored data.If the optional.I dataargument is provided, the file will initially contain that text.The parent directory of.I filemust exist;.I ramfilecreates a union mount on that directory, and if.I filepreviously existed, the synthesised file will hide it..PP.I Ramfileuses.IR sys-file2chan (2),which simplifies implementation but prevents it from knowingwhen the file has been truncated.Instead, it truncates the file on any write to the start of the file(offset 0),allowing.IR cp (1)to copy in new contents, andtext editors to edit it.Indeed, the file will be usable by all applications that donot rely on updating parts of the file in place, or if they do,do not update the start of the file..SH SOURCE.B /appl/cmd/ramfile.b.SH SEE ALSO.IR bind (1),.IR sys-file2chan (2),.IR srv (3),.IR memfs (4).SH BUGS.I Ramfilecannot tell when the.I pathhas been unmounted;the only option is to.IR kill (1)it..brThe.I filealways appears to have zero length to.IR sys-stat (2),which prevents loading a Dis file from it.