Logo Search packages:      
Sourcecode: fuse version File versions  Download package

size_t fuse_add_direntry ( fuse_req_t  req,
char *  buf,
size_t  bufsize,
const char *  name,
const struct stat *  stbuf,
off_t  off 
)

Add a directory entry to the buffer

Buffer needs to be large enough to hold the entry. Of it's not, then the entry is not filled in but the size of the entry is still returned. The caller can check this by comparing the bufsize parameter with the returned entry size. If the entry size is larger than the buffer size, the operation failed.

From the 'stbuf' argument the st_ino field and bits 12-15 of the st_mode field are used. The other fields are ignored.

Note: offsets do not necessarily represent physical offsets, and could be any marker, that enables the implementation to find a specific point in the directory stream.

Parameters:
req request handle
buf the point where the new entry will be added to the buffer
bufsize remaining size of the buffer
the name of the entry
stbuf the file attributes
off the offset of the next entry
Returns:
the space needed for the entry

Definition at line 236 of file fuse_lowlevel.c.

References fuse_add_direntry().

Referenced by fuse_add_direntry().

{
      size_t entsize;

      (void) req;
      entsize = fuse_dirent_size(strlen(name));
      if (entsize <= bufsize && buf)
            fuse_add_dirent(buf, name, stbuf, off);
      return entsize;
}


Generated by  Doxygen 1.6.0   Back to index