func (h *fshandler) Stat(sessionID [16]byte, request *stat.Request) (xrdproto.Marshaler, xrdproto.ResponseStatus) {
	if request.Options&stat.OptionsVFS != 0 {
		// TODO: handle virtual stat info.
		return xrdproto.ServerError{
			Code:    xrdproto.InvalidRequest,
			Message: "Stat request with OptionsVFS is not implemented",
		}, xrdproto.Error
	}

	var fi os.FileInfo
	var err error
	if len(request.Path) == 0 {
		file := h.getFile(sessionID, request.FileHandle)
		if file == nil {
			return xrdproto.ServerError{
				Code:    xrdproto.InvalidRequest,
				Message: fmt.Sprintf("Invalid file handle: %v", request.FileHandle),
			}, xrdproto.Error
		}
		fi, err = file.Stat()
	} else {
		fi, err = os.Stat(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
	}

	return stat.DefaultResponse{EntryStat: xrdfs.EntryStatFrom(fi)}, xrdproto.Ok
}
// Stat implements server.Handler.Stat.
Stat implements server.Handler.Stat.
// Stat implements server . Handler . Stat .
func (h *fshandler) Stat(sessionID [16]byte, request *stat.Request) (xrdproto.Marshaler, xrdproto.ResponseStatus) {
	if request.Options&stat.OptionsVFS != 0 {
		return xrdproto.ServerError{
			Code:    xrdproto.InvalidRequest,
			Message: "Stat request with OptionsVFS is not implemented",
		}, xrdproto.Error
	}
	var fi os.FileInfo
	var err error
	if len(request.Path) == 0 {
		file := h.getFile(sessionID, request.FileHandle)
		if file == nil {
			return xrdproto.ServerError{
				Code:    xrdproto.InvalidRequest,
				Message: fmt.Sprintf("Invalid file handle: %v", request.FileHandle),
			}, xrdproto.Error
		}
		fi, err = file.Stat()
	} else {
		fi, err = os.Stat(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
	}
	return stat.DefaultResponse{EntryStat: xrdfs.EntryStatFrom(fi)}, xrdproto.Ok
}
func ( h * fshandler ) Stat ( sessionID [ 16 ] byte , request * stat . Request ) ( xrdproto . Marshaler , xrdproto . ResponseStatus ) { if request . Options & stat . OptionsVFS != 0 { return xrdproto . ServerError { Code : xrdproto . InvalidRequest , Message : " " , } , xrdproto . Error } var fi os . FileInfo var err error if len ( request . Path ) == 0 { file := h . getFile ( sessionID , request . FileHandle ) if file == nil { return xrdproto . ServerError { Code : xrdproto . InvalidRequest , Message : fmt . Sprintf ( " " , request . FileHandle ) , } , xrdproto . Error } fi , err = file . Stat ( ) } else { fi , err = os . Stat ( path . Join ( h . basePath , request . Path ) ) } if err != nil { return xrdproto . ServerError { Code : xrdproto . IOError , Message : fmt . Sprintf ( " " , err ) , } , xrdproto . Error } return stat . DefaultResponse { EntryStat : xrdfs . EntryStatFrom ( fi ) } , xrdproto . Ok }
Stat implements server.Handler.Stat.
Stat implements server . Handler . Stat .
// TODO: handle virtual stat info.