* src/common.h (full_time_option): New global.
* src/tar.c (FULL_TIME_OPTION): New constant.
(options): New option --full-time.
(parse_opt): Handle the --full-time option.
* src/list.c (simple_print_header): Pass full_time_option
as the 2nd argument to tartime.
* doc/tar.texi: Update.
* NEWS: Update.
-GNU tar NEWS - User visible changes. 2010-03-27
+GNU tar NEWS - User visible changes. 2010-03-28
Please send GNU tar bug reports to <bug-tar@gnu.org>
\f
+* The --full-time option.
+
+New command line option `--full-time' instructs tar to output file
+time stamps to the full resolution.
+
* Bugfixes.
** Spurious error diagnostics on broken pipe.
** The --null option disabled handling of tar options in list files. This
is fixed.
-** Fixed record size autodetection. If detected record size differs from
-the expected value (either default, or set on the command line), tar
-always prints a warning if verbosity level is set to 1 or greater,
-i.e. if either -t or -v option is given.
+** Fixed record size autodetection. If the detected record size differs from
+the expected value (either default one, or the one set from the
+command line), tar always prints a warning if verbosity level is set
+to 1 or greater, i.e. if either -t or -v option is given.
\f
When supplied an archive smaller than 512 bytes in reading mode (-x,
-t), the previous version of tar silently ignored it, exiting with
-code 0. It is fixed. Tar now issues the following diagnostic message:
+code 0. It is fixed. Tar now issues the following diagnostic message:
'This does not look like a tar archive', and exits with code 2.
* Fix double-dot recognition in archive member names in case of duplicate '/.'.
@xref{Formats}, for a detailed discussion of these formats.
+@opsummary{full-time}
+@item --full-time
+This option instructs @command{tar} to print file times to their full
+resolution. Usually this means 1-second resolution, but that depends
+on the underlying file system. The @option{--full-time} option takes
+effect only when detailed output (verbosity level 2 or higher) has
+been requested using the @option{--verbose} option, e.g., when listing
+or extracting archives:
+
+@smallexample
+$ @kbd{tar -t -v --full-time -f archive.tar}
+@end smallexample
+
+@noindent
+or, when creating an archive:
+
+@smallexample
+$ @kbd{tar -c -vv --full-time -f archive.tar .}
+@end smallexample
+
+Notice, thar when creating the archive you need to specify
+@option{--verbose} twice to get a detailed output (@pxref{verbose
+tutorial}).
+
@opsummary{group}
@item --group=@var{group}
/* Display file times in UTC */
GLOBAL bool utc_option;
+/* Output file timestamps to the full resolution */
+GLOBAL bool full_time_option;
/* This variable tells how to interpret newer_mtime_option, below. If zero,
files get archived if their mtime is not less than newer_mtime_option.
/* Time stamp. */
- time_stamp = tartime (st->mtime, false);
+ time_stamp = tartime (st->mtime, full_time_option);
time_stamp_len = strlen (time_stamp);
if (datewidth < time_stamp_len)
datewidth = time_stamp_len;
EXCLUDE_TAG_ALL_OPTION,
EXCLUDE_VCS_OPTION,
FORCE_LOCAL_OPTION,
+ FULL_TIME_OPTION,
GROUP_OPTION,
IGNORE_CASE_OPTION,
IGNORE_COMMAND_ERROR_OPTION,
"Allowed signals are: SIGHUP, SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; "
"the names without SIG prefix are also accepted"), GRID+1 },
{"utc", UTC_OPTION, 0, 0,
- N_("print file modification dates in UTC"), GRID+1 },
+ N_("print file modification times in UTC"), GRID+1 },
+ {"full-time", FULL_TIME_OPTION, 0, 0,
+ N_("print file time to its full resolution"), GRID+1 },
{"index-file", INDEX_FILE_OPTION, N_("FILE"), 0,
N_("send verbose output to FILE"), GRID+1 },
{"block-number", 'R', 0, 0,
info_script_option = arg;
multi_volume_option = true;
break;
+
+ case FULL_TIME_OPTION:
+ full_time_option = true;
+ break;
case 'g':
listed_incremental_option = arg;