Ich möchte berühren meine Dateien aus C-Code, um ihr Zugriffsdatum zu ändern. Dies scheint nicht zu funktionieren:Wie schreibe ich Dateimodifikationsdaten programmgesteuert in POSIX?
struct stat fileSt;
lstat(path, &fileSt);
fileSt.st_mtime = time(NULL);
Vielen Dank für Ihre Hilfe.
Ich glaube, strace ist Linux-spezifisch und das OP hat nicht erwähnt, welche UNIX er verwendet hat (Solaris, FreeBSD, etc, haben ähnliche Befehle, aber nicht strace). – bortzmeyer
Seltsam, markiert POSIX utimes() als Vermächtnis, obwohl es mehr Funktionalität als utime() – Chris
@Chris nicht mehr bietet. Laut Ausgabe 7 "Die LEGACY-Markierung wird entfernt.". Quelle: http://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html – Alexandros