rename ändert dateizeiten

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • rename ändert dateizeiten

    ich arbeite in einer wamp-umgebung.

    wenn ich
    PHP Code:
    rename() 
    benutze wird die datei nicht nur verschoben sondern auch sämtliche dateizeiten neu gesetzt. (das gleich mit copy).

    gibt es eine trick um die alte dateizeit bezubehalten.

    danke

  • #2
    Welche Windows-Version hast du denn? Kannst du die selben Effekte auch beobachten, wenn du Dateien direkt bearbeitest oder passiert das nur mit PHP?

    Comment


    • #3
      Aus den User Notes im Manual (zu copy())
      When using copy on win32 (don't know about anywhere else), copy sets the 'last modified time' of the the new copy to the current time instead of that of the source (win32 copy preserves last modified time). If you are tracking backups by last modified time, use:
      Gruss

      tobi
      Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

      [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
      Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

      Comment


      • #4
        danke tobi, das wars!

        die lösung zum verschieben einer datei könnte dann wie folgt aussehen:

        PHP Code:
        copy($src$dest);
        touch($destfilemtime($src));
        unlink($src); 
        danke super Forum

        Comment

        Working...
        X