WinRAR Switch -TS[m|c|a][+|-|1] - save or restore file time (modification, creation, access)


Switch -TS[m|c|a][+|-|1] - save or restore file time (modification, creation, access)


Use -tsm to save the file modification time, -tsc for creation time and -tsa for last access time. Multiple -ts switches, such as -tsc -tsa, are allowed. If 'm', 'c' or 'a' are not specified, all three file times are assumed.

Append '+' to store a file time with maximum possible precision. Concrete value depends on a operating system and file system and can be up 100 nanoseconds in Windows and 1 nanosecond in Unix. Append '1' to set 1 second precision or '-' to not save a file time. If '+', '-' or '1' are not present, '+' is assumed, so -ts+ and -ts both save all three high precision times.

RAR 4.x archives always contain the modification time and for RAR 4.x archive -tsm- still saves the modification time with the lowest possible 2 second precision. Two other times can be disabled. RAR archives allow to omit any file time including modification, so unpacked files will have the current system time. Switches -tsm- -tsc- -tsa or just -ts- will store a low precision modification time for RAR 4.x and no file time for RAR 5.x archive.

If -ts switch is not specified, RAR stores the high precision modification time and omits two other times.

By default WinRAR sets only the modification time for extracted files, even if archive contains other times. Use -ts or -ts+ when unpacking to set all three times, -tsc and -tsa to set creation and last access times, -tsm- or -ts- to set the current system time instead of modification time stored in archive.

Windows allows to set all three file times when unpacking. In Unix we can set the modification and last access, but not creation time.

All modes described above are supported only by RAR format. In ZIP archives the high precision modification time is stored in the same data structure as creation and last access times. When archiving to ZIP, all three times are controlled by -ts or -tsm option, while -tsa and -tsc are ignored. Use -ts or -tsm to save all times in high precision format (default ZIP mode), specify -ts- or -tsm- to store only the low precision modification time. When unpacking ZIP archive, -tsm -tsc -tsa switches can be used individually to control corresponding times just like as for RAR format.

Examples

  1. Store all file times with the highest possible precision:

WinRAR a -ts backup

  1. Restore modification and last access time. Switch -tsm is not required, because RAR sets the modification time by default. If we wish to restore only the last access time, we should use -tsm- -tsa switches:

WinRAR x -tsa backup

  1. Store low precision modification and creation time.

WinRAR a -tsm1 -tsc1 backup