- Notifications
You must be signed in to change notification settings - Fork928
fix: Resolve symlinks being written with size 0 in tar#1488
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Solution found here:https://stackoverflow.com/questions/38454850/getting-write-too-long-error-when-trying-to-create-tar-gz-file-from-file-and-dSymlink's were being written with a size of 0, which surfaced an errorfor write too long.
var link string | ||
if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { | ||
link, err = os.Readlink(file) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
header, err := tar.FileInfoHeader(fileInfo, link) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a bit confusing. It seems like this only works for symlinks, since we're no longer using thefile
var if it's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The second arg is actually only alink
. It was implemented incorrectly beforehand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
So it should be empty if the file isn't a symlink?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I believe so
Solution found here:https://stackoverflow.com/questions/38454850/getting-write-too-long-error-when-trying-to-create-tar-gz-file-from-file-and-dSymlink's were being written with a size of 0, which surfaced an errorfor write too long.
Solution found here:
https://stackoverflow.com/questions/38454850/getting-write-too-long-error-when-trying-to-create-tar-gz-file-from-file-and-d
Symlink's were being written with a size of 0, which surfaced an error
for write too long.