[R] tar()/untar() argument symmetry

Roebuck,Paul L proebuck at mdanderson.org
Tue Oct 18 20:47:27 CEST 2016


On 10/18/16, 12:52 PM, "Duncan Murdoch" <murdoch.duncan at gmail.com> wrote:

>On 18/10/2016 12:38 PM, Roebuck,Paul L wrote:
>> Any reason untar() has an "exdir" argument (the equivalent of "tar -C"),
>> but tar() does not?
>
>Because you can specify the source directory in the files argument using
>list.files().  There's no need to duplicate that in tar().

But that solution introduces (undesired) intermediate directory paths
into the tar archive.


Any other thoughts outside using something like below:

stopifnot(dir.exists(local))
savedir <- ""
tryCatch({
    savedir <- setwd(local)
    tar(Š)
  },
  finally = setwd(savedir))

The information contained in this e-mail message may be privileged, confidential, and/or protected from disclosure. This e-mail message may contain protected health information (PHI); dissemination of PHI should comply with applicable federal and state laws. If you are not the intended recipient, or an authorized representative of the intended recipient, any further review, disclosure, use, dissemination, distribution, or copying of this message or any attachment (or the information contained therein) is strictly prohibited. If you think that you have received this e-mail message in error, please notify the sender by return e-mail and delete all references to it and its contents from your systems.



More information about the R-help mailing list