2014-06-08 10:13:29 +04:00
|
|
|
/* This file is part of ToaruOS and is released under the terms
|
|
|
|
* of the NCSA / University of Illinois License - see LICENSE.md
|
|
|
|
* Copyright (C) 2013 Kevin Lange
|
|
|
|
*/
|
2012-07-07 08:08:28 +04:00
|
|
|
/*
|
|
|
|
* touch
|
|
|
|
*
|
|
|
|
* Creates a file or updates its last-modified date.
|
|
|
|
* (in theory)
|
|
|
|
*/
|
2012-05-31 15:37:16 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
int main(int argc, char * argv[]) {
|
|
|
|
if (argc < 2) {
|
|
|
|
fprintf(stderr, "%s: argument expected\n", argv[0]);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2013-04-24 11:20:07 +04:00
|
|
|
FILE * f = fopen(argv[1], "a");
|
2016-12-14 15:21:32 +03:00
|
|
|
if (!f) {
|
|
|
|
perror(argv[0]);
|
|
|
|
return 1;
|
|
|
|
}
|
2012-05-31 15:37:16 +04:00
|
|
|
fclose(f);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|