Commit 7f9a7dfa authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: doc NewReadOnlyFile.

parent f46124a2
......@@ -204,15 +204,20 @@ func (f *loopbackFile) GetAttr(a *fuse.Attr) fuse.Status {
////////////////////////////////////////////////////////////////
// NewReadOnlyFile wraps a File so all read/write operations are
// denied.
func NewReadOnlyFile(f File) File {
return &readOnlyFile{File: f}
}
// readOnlyFile is a wrapper that denies writable operations
type readOnlyFile struct {
File
}
func (f *readOnlyFile) InnerFile() File {
return f.File
}
func (f *readOnlyFile) String() string {
return fmt.Sprintf("readOnlyFile(%s)", f.File.String())
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment