#!/bin/bash

if [ $# -ne 1 ]; then
	echo "Usage: $0 directory"
	exit
fi

# file_info(path(/bin/exe), type(dir), owner(0), group(0), 
# uper(1,1,1), gper(1,0,1), oper(1,0,1),
# setuid(0), setgid(0), sticky(0))

find $1 | xargs -i /home/chen131/collector/mystat '{}' "file_info(path('%fn'), \
type(%tp), owner(%wn), group(%gp), \
uper(%ur,%uw,%ux), gper(%gr,%gw,%gx), oper(%or,%ow,%ox), \
setuid(%su), setgid(%sg), sticky(%ss))."
