Started on AppendDirent.

Aaron Jacobs 2015-02-27 11:19:49 +11:00
parent 909297b87a
commit 4f4362773e
1 changed files with 12 additions and 1 deletions

View File

@ -28,4 +28,15 @@ type Dirent struct {
// Append the supplied directory entry to the given buffer in the format
// expected in fuse.ReadResponse.Data, returning the resulting buffer.
func AppendDirent(buf []byte, d Dirent) []byte
func AppendDirent(buf []byte, d Dirent) []byte {
// We want to append bytes with the layout of fuse_dirent
// ( in host order. Its layout is reproduced here for
// documentation purposes:
type fuse_dirent struct {
ino uint64
off uint64
namelen uint32
type_ uint32
name [0]byte