#include "gbos.h" /* touch FILE...: create FILE if it does not exist, leave it alone if it does. * * There are no timestamps in gbfs (no RTC on an MBC5 cart), so touch only does * the half that means anything here: make an empty file. O_APPEND is exactly * right for it - it creates, and it does NOT truncate what is already there. */ void main(void) { char *argv[8]; unsigned char argc = argv_parse(argv, 8); unsigned char i, fd; if (argc < 1) { puts("usage: touch FILE..."); nl(); sexit(2); } for (i = 0; i < argc; i++) { fd = open(argv[i], O_APPEND); if (fd > 3) { puts("touch: cannot create "); puts(argv[i]); nl(); continue; } close(fd); } }