func (s *Scanner) Dirent() (*Dirent, error) {
	if s.de == nil {
		s.de = &Dirent{name: s.childName, path: s.osDirname}
		s.de.modeType, s.statErr = modeTypeFromDirent(&s.sde, s.osDirname, s.childName)
	}
	return s.de, s.statErr
}
Dirent returns the current directory entry while scanning a directory.
package godirwalk
import (
	"os"
	"syscall"
	"unsafe"
)
type Scanner struct {
	scratchBuffer []byte  
	workBuffer    []byte  
	osDirname     string
	childName     string
	err           error     
	statErr       error     
	dh            *os.File  
	de            *Dirent   
	sde           syscall.Dirent
	fd            int  
}
func NewScanner(osDirname string) (*Scanner, error) {
	return NewScannerWithScratchBuffer(osDirname, nil)
}
func NewScannerWithScratchBuffer(osDirname string, scratchBuffer []byte) (*Scanner, error) {
	dh, err := os.Open(osDirname)
	if err != nil {
		return nil, err
	}
	if len(scratchBuffer) < MinimumScratchBufferSize {
		scratchBuffer = newScratchBuffer()
	}
	scanner := &Scanner{
		scratchBuffer: scratchBuffer,
		osDirname:     osDirname,
		dh:            dh,
		fd:            int(dh.Fd()),
	}
	return scanner, nil
}