From 4f4362773ebcab9d8f17f6b93ccdf3f20c103d95 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 27 Feb 2015 11:19:49 +1100 Subject: [PATCH] Started on AppendDirent. --- fuseutil/dirent.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fuseutil/dirent.go b/fuseutil/dirent.go index 32e6eea..1009869 100644 --- a/fuseutil/dirent.go +++ b/fuseutil/dirent.go @@ -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 + // (http://goo.gl/BmFxob) 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 + } +}