Added restoring of original file attributes (rights, accessed/modified dates)
Convert time_t to uint64t for clarity