Switch -TS<m,c,a>[N] - save or restore file time (modification, creation, access)


Switch -tsm instructs WinRAR to save file modification time, -tsc - creation time and tsa - last access time. Optional parameter after the switch is the number between 0 and 4 controlling the file time precision. Value '1' enables 1 second precision, 2 - 0.0065536 sec, 3 - 0.0000256 and 4 or '+' enables the maximum NTFS time precision, which is equal to 0.0000001 sec. Value '0' or '-' means that creation and access time are not saved and low (two seconds) precision is used for modification time. Higher precision modes add more data to archive, up to 19 additional bytes per file in case of -tsm4 -tsa4 -tsc4 combination. If no precision is specified, WinRAR uses '4' (high) value.

Default WinRAR mode is -tsm4 -tsc0 -tsa0, so modification time is stored with the high precision and other times are ignored.

It is necessary to specify -tsc and -tsa switches to set creation and access time when unpacking files (precision is irrelevant, but must not be 0). By default WinRAR sets only the modification time, even if archive contains creation and last access time. Setting the modification time to unpacked files may be also disabled with -tsm-.

It is possible to omit the time type letter if you need to apply the switch to all three times. For example, -tsm4 -tsa4 -tsc4 can be replaced by -ts4, -ts+ or -ts. Use -ts- to save only the low precision modification time or to ignore all three file times on unpacking.

When creating an archive, WinRAR automatically reduces the precision if high mode is not supported by the file system. It is not more than 2 seconds on FAT and 1 second in Unix. NTFS time precision is 0.0000001 second.

Operating systems limit which time can be set on unpacking. Windows allows to set all three times, Unix - modification and last access, but not creation, DOS supports only the modification time.

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 WinRAR uses it by default:

WinRAR x -tsa backup

  1. Store low precision modification and creation time. Without -tsm1 WinRAR would save the high precision modification time.

WinRAR a -tsm1 -tsc1 backup