archive/tar on windows

71 views
Skip to first unread message

Fredrik Enestad

unread,
Dec 11, 2024, 11:14:19 AM12/11/24
to golang-nuts
It seems the FileInfoHeader does not handle junction points on windows. I expected it to handle it like os.Readlink and just pretend its a symbolic link, but instead this error is raised:

archive/tar: unknown file mode ?rw-rw-rw-

I don't know too much about junction points, but is there a reason not to handle them here as symbolic links? or should I raise an issue about this?

Example code to replicate:

package main

import (
"archive/tar"
"fmt"
"os"
)

func main() {
path := "C:\\path\\to\\junction\\point"
fi, _ := os.Lstat(path)
_, err := tar.FileInfoHeader(fi, "link")
fmt.Println(err)
}

Reply all
Reply to author
Forward
0 new messages