func (h *fshandler) Dirlist(sessionID [16]byte, request *dirlist.Request) (xrdproto.Marshaler, xrdproto.ResponseStatus) {
	files, err := ioutil.ReadDir(path.Join(h.basePath, request.Path))
	if err != nil {
		return xrdproto.ServerError{
			Code:    xrdproto.IOError,
			Message: fmt.Sprintf("An IO error occurred: %v", err),
		}, xrdproto.Error
	}

	resp := &dirlist.Response{
		WithStatInfo: request.Options&dirlist.WithStatInfo != 0,
		Entries:      make([]xrdfs.EntryStat, 0, len(files)),
	}

	for _, file := range files {
		entry := xrdfs.EntryStatFrom(file)
		entry.HasStatInfo = resp.WithStatInfo
		resp.Entries = append(resp.Entries, entry)
	}

	return resp, xrdproto.Ok
}
// Dirlist implements server.Handler.Dirlist.
Dirlist implements server.Handler.Dirlist.
// Dirlist implements server . Handler . Dirlist .
func (h *fshandler) Dirlist(sessionID [16]byte, request *dirlist.Request) (xrdproto.Marshaler, xrdproto.ResponseStatus) {
	files, err := ioutil.ReadDir(path.Join(h.basePath, request.Path))
	if err != nil {
		return xrdproto.ServerError{
			Code:    xrdproto.IOError,
			Message: fmt.Sprintf("An IO error occurred: %v", err),
		}, xrdproto.Error
	}
	resp := &dirlist.Response{
		WithStatInfo: request.Options&dirlist.WithStatInfo != 0,
		Entries:      make([]xrdfs.EntryStat, 0, len(files)),
	}
	for _, file := range files {
		entry := xrdfs.EntryStatFrom(file)
		entry.HasStatInfo = resp.WithStatInfo
		resp.Entries = append(resp.Entries, entry)
	}
	return resp, xrdproto.Ok
}
func ( h * fshandler ) Dirlist ( sessionID [ 16 ] byte , request * dirlist . Request ) ( xrdproto . Marshaler , xrdproto . ResponseStatus ) { files , err := ioutil . ReadDir ( path . Join ( h . basePath , request . Path ) ) if err != nil { return xrdproto . ServerError { Code : xrdproto . IOError , Message : fmt . Sprintf ( " " , err ) , } , xrdproto . Error } resp := & dirlist . Response { WithStatInfo : request . Options & dirlist . WithStatInfo != 0 , Entries : make ( [ ] xrdfs . EntryStat , 0 , len ( files ) ) , } for _ , file := range files { entry := xrdfs . EntryStatFrom ( file ) entry . HasStatInfo = resp . WithStatInfo resp . Entries = append ( resp . Entries , entry ) } return resp , xrdproto . Ok }
Dirlist implements server.Handler.Dirlist.
Dirlist implements server . Handler . Dirlist .