Skip to content

Commit

Permalink
Add --creationtime <posixtime>
Browse files Browse the repository at this point in the history
  • Loading branch information
gperciva committed Aug 6, 2015
1 parent 9f6fb0a commit da68672
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tar/bsdtar.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,15 @@ main(int argc, char **argv)
bsdtar->configfiles[bsdtar->nconfigfiles++] =
bsdtar->optarg;
break;
case OPTION_CREATIONTIME: /* tarsnap */
errno = 0;
bsdtar->creationtime = strtol(bsdtar->optarg,
NULL, 0);
if ((errno) || (bsdtar->creationtime == 0))
bsdtar_errc(bsdtar, 1, 0,
"Invalid --creationtime argument: %s",
bsdtar->optarg);
break;
case 'd': /* multitar */
set_mode(bsdtar, opt, "-d");
break;
Expand Down
1 change: 1 addition & 0 deletions tar/bsdtar.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ enum {
OPTION_CHECKPOINT_BYTES,
OPTION_CHROOT,
OPTION_CONFIGFILE,
OPTION_CREATIONTIME,
OPTION_DISK_PAUSE,
OPTION_DRYRUN,
OPTION_EXCLUDE,
Expand Down
1 change: 1 addition & 0 deletions tar/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static struct option {
{ "configfile", 1, OPTION_CONFIGFILE },
{ "confirmation", 0, 'w' },
{ "create", 0, 'c' },
{ "creationtime", 1, OPTION_CREATIONTIME },
{ "dereference", 0, 'L' },
{ "directory", 1, 'C' },
{ "disk-pause", 1, OPTION_DISK_PAUSE },
Expand Down

0 comments on commit da68672

Please sign in to comment.