-
Notifications
You must be signed in to change notification settings - Fork 18k
archive/tar: Writer produces bad tar files on Windows #34839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
CC @dsnet |
The same GNU tar installation on the same Linux that could read the ones produced on Linux for be was unable to read the files produced on Windows. I haven't done a binary comparison between the two. Since |
It was different, but... False alarm. Sorry about that. It looks like this is a problem with PowerShell. The Edit: If anyone stumbles across this at some point, see https://brianreiter.org/2010/01/29/powershells-object-pipeline-corrupts-piped-binary-data/. Apparently it converts everything to UTF-16 by default instead of just piping it through. There doesn't seem to be a generic way around it, unfortunately. |
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/dmkEunM6jGX
Running this on Linux or Darwin produces a tar file containing two files,
Test
andOther
, as expected. Running this on Windows, however, produces a file which thefile
command identifies asdata
, not a tar file, and running any tar command against it results in errors. Runningtar -t
with the GNUtar
command yieldswhile bsdtar, which the
tar.exe
that comes with Windows is a port of, yieldsThe text was updated successfully, but these errors were encountered: