File dates.
How would I code touch (command), in C, so I could execute it onto files?
|
fd=open(file, O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY|O_LARGEFILE, 0666);
close(fd); |
What if I was trying to change the date? with a touch -t?
|
utime(file, &utimebuf);
|
Is this written correctly? (I'm not too sure the actime and modtime are done correctly, nor do I know what the times format is aka, seconds, mins, hours)
#include <sys/time.h> main() { const char *filename = "file.c"; struct utimbuf *buf; *buf.time_t.actime = 5; *buf.time_t.modtime = 1; int utime(const char *filename, struct utimbuf *buf); return 0; } |
It's more something like this:
Code:
#include <sys/types.h> |
All times are GMT -5. The time now is 10:33 PM. |