php / php/php-src

Set file creation/change time in touch

Offen
#14,900 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Extension: standard Feature Status: Needs Triage
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

Description

With the touch function you can set the modification and access time, but not the creation/change time. I have several Windows applications where I need to set the creation time, for example a backup tool that needs to preserve the creation time. I have solved that with a C program that can set creation, modification and access times and that can be invoked from PHP using (Unix) sockets. But that is a relatively complicated solution, it would be much simpler/neater if you could set the creation time using touch.
It would also be nice if the copy function would have a flag to preserve ctime, mtime and a time. In that case a touch to reset ctime, mtime and atime would not be needed at all. But I have a PHP tool that sets ctime and mtime of JPG files based on the ctime and mtime in the Exif header, for that I need the touch solution. A flag in the copy function would be a partial solution, setting ctime with touch is a more general and complete solution.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die bestehenden touch- und copy-Einstiegspunkte in PHP zu überprüfen, und untersuche anschließend, wie Windows die Erstellungszeit im Vergleich zu Änderungs- und Zugriffszeiten darstellt. Lege die unterstützte Semantik zum Setzen oder Beibehalten dieser Zeitstempel fest und überprüfe das Verhalten auf den relevanten Plattformen; als erledigt gilt die Aufgabe, wenn die angeforderte Behandlung der Zeitstempel spezifiziert und durch Tests abgedeckt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, php
Bereich
backend, operating-systems
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.