mud/fluffos-2.23-ds03/Win32/touch.c
2020-09-06 05:43:07 -07:00

20 lines
360 B
C

#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/utime.h>
int main(int argc, char *argv[]) {
int i, handle;
for (i = 1; i <= argc; i++) {
if (access(argv[i], 0) == -1) {
handle = open(argv[i], _O_RDWR | _O_CREAT, _S_IREAD | _S_IWRITE);
close(handle);
} else {
utime(argv[i], NULL);
}
}
return 0;
}