Exemple #1
0
func fileCmd(out *redeo.Responder, req *redeo.Request) error {
	if len(req.Args) != 1 {
		return req.WrongNumberOfArgs()
	}

	file, err := root.Open(path.Clean(req.Args[0]))
	if err != nil {
		return err
	}

	stat, err := file.Stat()
	if err != nil {
		return err
	}

	out.WriteN(file, stat.Size())
	return nil
}