#include "prjlibs-include/standards.h" #include #include #include "skalibs/include/stddjb.h" #include "prjlibs-include/constants.h" #include "runwhen.h" char const* PROG="rw-touch"; int main(int argc, char** argv) { struct taia t; struct timeval tv[2]; if (argc<3) strerr_die3x(100, usage, PROG, " stamp filename [program...]"); rw_scan(&t, argv[1]); if (timeval_from_taia(&tv[0], &t)==0) strerr_die4x(100, PROG, ": timestamp", err_oflow, "timeval"); tv[1]=tv[0]; if (utimes(argv[2], tv)!=0) strerr_die5sys(errstat, PROG, err_unable, "set timestamp for ", argv[2], ": "); argv+=3; pathexec0_run((char const**)argv, (char const**)environ); strerr_die5sys(errstat, PROG, err_unable, err_exec, argv[0], ": "); }