Re: [go-nuts] Executing a tar command from within a Go program

2022-04-20 Thread Dean Schulze
The variadic args worked perfectly. Thanks. I did not use the archive/tar and compress/gzip approach because that wold be a lot more complicated than just executing a tar command. Those packages are oriented towards reading/writing the contents of archive/compressed files into the program rat

Re: [go-nuts] Executing a tar command from within a Go program

2022-04-20 Thread 'Axel Wagner' via golang-nuts
On Wed, Apr 20, 2022 at 6:16 PM Dean Schulze wrote: > I need to execute this tar command > > *tar xzf dir1/dir2/somefile.tgz --directory=dir1/dir2/* > > from within a Go program. I've verified that it works from the command > line. I've tried using > > > *argStr := "xzf dir1/dir2/somefile.tgz -

Re: [go-nuts] Executing a tar command from within a Go program

2022-04-20 Thread 'wagner riffel' via golang-nuts
Also, the Output method only returns what was wrote to stdout, tar argument parsing errors are probably in stderr, using CombinedOutput() has better effect to debug. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group a

Re: [go-nuts] Executing a tar command from within a Go program

2022-04-20 Thread 'wagner riffel' via golang-nuts
On Wed Apr 20, 2022 at 6:16 PM CEST, Dean Schulze wrote: > I need to execute this tar command > > *tar xzf dir1/dir2/somefile.tgz --directory=dir1/dir2/* > Did you considered using the packages "archive/tar" and "compress/gzip" to achive this? > *argStr := "xzf dir1/dir2/somefile.tgz --directory=