/usr/share/gocode/src/github.com/mitchellh/go-fs/fat/file.go is in golang-github-mitchellh-go-fs-dev 0.0~git20161108.7bae45d-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | package fat
type File struct {
chain *ClusterChain
dir *Directory
entry *DirectoryClusterEntry
}
func (f *File) Read(p []byte) (n int, err error) {
return f.chain.Read(p)
}
func (f *File) Write(p []byte) (n int, err error) {
lastByte := f.chain.writeOffset + uint32(len(p))
if lastByte > f.entry.fileSize {
// Increase the file size since we're writing past the end of the file
f.entry.fileSize = lastByte
// Write the entry out
if err := f.dir.dirCluster.WriteToDevice(f.dir.device, f.dir.fat); err != nil {
return 0, err
}
}
return f.chain.Write(p)
}
|