• Timestamp on folders

    Author
    Topic
    #375219

    I would like to copy an entire directory structure and maintain the original timestamps on the folders. Is there a way to do this.

    I have tried copy, xcopy and roboCopy. roboCopy works sometimes but is not consistant.

    An alternative would be to update the timestamp after the folders are created. However the version of “Touch.exe” which ships with the NT Resourse Kit does not allow a time to be passed as a parameter, as the Unix version does.

    If my memory serves me correcly, there are some API calls to accomplish this, but writting my own code seems like the hard way to solve a simple problem.

    Anyone had experience with this? Thanks.

    Viewing 1 reply thread
    Author
    Replies
    • #609937

      Have you tried a backup, then restoring to the (‘copy’) destination folder?

    • #612012

      My version of TOUCH (1996/07/25 13:51, 47376 bytes) is used as follows:

      TOUCH [/t year month day hour min sec] files

      • #612062

        Thanks. If I type Touch, with no params, the help I get is simply [-cf] file …. However /t does work. However, I need to update folder times and now I find touch does not work on folders. Backup and Restore does not work on the folders either. I have not tried the API call SetFileTime, but I suspect it also will not work.

        I remember many years ago, when disk volumes were small, using Norton’s Utilities to edit the FAT table and if my memory is any good, the times were able to be edited. In this case however, editing one by one is not a choice, since we are moving large volumes of data from one area to another.

        • #612065

          If I do TOUCH or TOUCH -? I get an error message, and the (trivial!) help information I indicated. It seems to me that you’re using the Posix version!

          You’re right that TOUCH doesn’t work on directories=folders, and neither does my “other” date/time-changing utility SETFILEDATE.

          I haven’t found a utility that changes either the Created or Modified dates on a directory, and who cares about the Last accessed date?

          • #612076

            I guess the other option would be to change the time on the system for each directory I want to duplicate.

            What is interesting is Robocopy (Ships with NT Resource kit) will keep the original directory date, sometimes. It is not consistant.

            • #612079

              ROBOCOPY seems to do a better job of mirroring directories than anything else I know.

              However the principle of the folder date (presumably the Last Modified date?) relates to the last time anyone wrote a file into that directory, so will change whenever any file is written. Only if nothing is touched (sorry, not a pun!) will the folder date remain at the value you originally set it at. So I wouldn’t hold out much hope of the value remaining “correct”, even if you could set the date on the folder… I suspect ROBOCOPY rewrites the folder date after it’s copied all the files.

    Viewing 1 reply thread
    Reply To: Timestamp on folders

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: