@@ -52,8 +52,8 @@ untar(tarfile, files = NULL, list = FALSE, exdir = ".",
5252  }
5353
5454  \item {extras }{\code {NULL } or  a  character  string :  further  command - line 
55-     flags  such  as  \option {- p }  or  \option {- P } to  be  passed   to   an   external 
56-     \command {tar } program. }
55+     flags  such  as  \option {- p }, \ option { - P }  or  \option {- k } to  be  passed 
56+     to   an   external   \command {tar } program. }
5757
5858  \item {verbose }{logical :  if  true  echo  the  command  used  for  an  external 
5959    \command {tar } program. }
@@ -112,36 +112,36 @@ untar(tarfile, files = NULL, list = FALSE, exdir = ".",
112112      compression. 
113113
114114      On  a  Unix - alike , \command {configure } will  set  environment  variable 
115-       \env {TAR }, preferring  GNU  tar  if  found. }
115+       \env {TAR }, preferring  GNU  tar  if  found  as  \command {gtar } or 
116+       \command {gnutar }. }
116117
117118    %%  bsdtar  had  it  in  FreeBSB  5.3  (2004 )
118-     \item {\code {bsdtar }: }{macOS  10.6  and  later (and  FreeBSD  and  some 
119-       other  OSes ) have  a  \command {tar } from  the  \I {libarchive } project 
120-       which  detects  known - to - it  forms  of  compression  automagically. 
121-       However , this  may  rely  on  an  external  command  being  available :  macOS 
122-       has  a  tar  which  knows  about  \code {zstd } compression , but  relies 
123-       on  a  \command {zstd } command  which  it  does  not  supply. 
119+     \item {\code {bsdtar }: }{macOS  10.6  and  later (and  FreeBSD , NetBSD  > =  9 
120+       and  some  other  OSes ) have  a  \command {tar } from  the  \I {libarchive }
121+       project  which  detects  known - to - it  forms  of  compression 
122+       automagically.   However , this  may  rely  on  an  external  command 
123+       being  available :  macOS  has  a  tar  which  knows  about  \code {zstd }
124+       compression , but  relies  on  a  \command {zstd } command  which  it  does 
125+       not  supply. 
124126
125127      This  added  support  for  \command {xz } in  2019  and  for  \command {zstd }
126128      in  2020  (if  the  appropriate  library  or  external  program  is 
127129      available ). 
128-     }
129130
130-     \item {NetBSD : }{It  is  undocumented  if  \I {NetBSD }' s \c ommand{tar} can
131-       detect compression automagically: for versions before 8 the flag 
132-       for \c ommand{xz} compression was \o ption{--xz} not \o ption{-J}. 
133-       So \c ode{support_old_tars = TRUE} is recommended (or use 
134-       \c ommand{bsdtar} if installed).} 
131+       Recent  versions  of  Windows  supply  a  build  of  \code {bsdtar } as 
132+       \code {tar.exe }, but  with  compiled - in  support  only  for  \code {gzip }
133+       compresssion. 
134+     }
135135
136136    %%  https : // news.ycombinator.com / item ?id = 10722697 
137137    \item {OpenBSD : }{\I {OpenBSD }' s \c ommand{tar} does not detect compression
138138      automagically.  It has no support for \c ommand{xz} beyond reporting 
139139      that the file is \c ommand{xz}-compressed.  So \c ode{support_old_tars 
140140	= TRUE} is recommended.} 
141141
142-     \item {Heirloom  Toolchest : }{This  \command {tar } does  automagically 
143-       detect  \command {gzip } and  \command {bzip2 } compression (undocumented )
144-       but  had  no  support  for  \command {xz } nor  \command {zstd } compression. }
142+     %%  \i tem{Heirloom Toolchest:}{This \c ommand{tar} does automagically 
143+     %%    detect \c ommand{gzip} and \c ommand{bzip2} compression (undocumented) 
144+     %%    but had no support for \c ommand{xz} nor \c ommand{zstd} compression.} 
145145
146146    \i tem{Older support:}{Environment variable \e nv{R_GZIPCMD} gives the 
147147      command to decompress \c ommand{gzip} files, and 
@@ -151,8 +151,8 @@ untar(tarfile, files = NULL, list = FALSE, exdir = ".",
151151      decompression is expected to fail.} 
152152  } 
153153
154-   Arguments  \code {compressed }, \ code { extras }  and  \code {verbose } are  only 
155-   used   when   an   external  \command {tar }  is   used .
154+   Arguments \c ode{compressed}  and \c ode{verbose} are only used for an  
155+   external \c ommand{tar}. 
156156
157157  Some external \c ommand{tar} commands will detect some of 
158158  \c ommand{lrzip}, \c ommand{lzma}, \c ommand{lz4} and \c ommand{lzop} 
@@ -174,12 +174,11 @@ untar(tarfile, files = NULL, list = FALSE, exdir = ".",
174174  handle files compressed by any of the methods that function can 
175175  handle: at least \c ommand{compress}, \c ommand{gzip}, \c ommand{bzip2}, 
176176  \c ommand{xz} and \c ommand{zstd} compression, and some types of 
177-   \command {lzma } compression.   It  does  not  guard  against  restoring 
178-   absolute  file  paths , as  some  \command {tar } implementations  do.   It 
179-   will  create  the  parent  directories  for  directories  or  files  in  the 
180-   archive  if  necessary.   It  handles  the  \I {USTAR }/ POSIX , GNU  and 
181-   \command {pax } ways  of  handling  file  paths  of  more  than  100  bytes , and 
182-   the  GNU  way  of  handling  link  targets  of  more  than  100  bytes. 
177+   \c ommand{lzma} compression.  It will create the parent directories for 
178+   directories or files in the archive if necessary.  It handles the 
179+   \I {USTAR}/POSIX, GNU and \c ommand{pax} ways of handling file paths of 
180+   more than 100 bytes, and the GNU way of handling link targets of more 
181+   than 100 bytes. 
183182
184183  You may see warnings from the internal implementation such 
185184  as \p reformatted{    unsupported entry type '  x ' }
@@ -206,7 +205,12 @@ untar(tarfile, files = NULL, list = FALSE, exdir = ".",
206205  \command {bsdtar } remove  the  leading  slash  on  absolute  filepaths : 
207206  specify  \code {extras  =  " -P" to  override  this.  \command {bsdtar }
208207  refuses  to  extract  paths  containing  \code {" .." with  the  same 
209-   workaround. 
208+   workaround.   The  internal  implementation  removes  leading  slashes (with 
209+   a  warning ) and  stops  with  an  error  for  paths  starting  with  \code {" ~" 
210+   or  containing  \code {" .." . 
211+   
212+   Extracted  files  will  overwrite  any  existing  file  unless  flag  \option {- k }
213+   is  included  in  \code {extras }. 
210214}
211215
212216\value {
0 commit comments