Skip to content

billy.File interface is missing Stat() for io/fs compatibility #120

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

Open
jmgilman opened this issue Mar 15, 2025 · 1 comment
Open

billy.File interface is missing Stat() for io/fs compatibility #120

jmgilman opened this issue Mar 15, 2025 · 1 comment

Comments

@jmgilman
Copy link

jmgilman commented Mar 15, 2025

The io/fs package defines a File interface as such:

type File interface {
	Stat() ([FileInfo](https://pkg.go.dev/io/fs#FileInfo), [error](https://pkg.go.dev/builtin#error))
	Read([][byte](https://pkg.go.dev/builtin#byte)) ([int](https://pkg.go.dev/builtin#int), [error](https://pkg.go.dev/builtin#error))
	Close() [error](https://pkg.go.dev/builtin#error)
}

When attempting to interface with a third-party package that uses this interface, I noticed I could not pass a billy.File because it's missing the Stat() method. This seems like an oversight.

@pjbgf
Copy link
Member

pjbgf commented Mar 19, 2025

@jmgilman have you tried this with the latest from main? The File interface was updated recently and now includes fs.File. This will be released on the next major release v6, release date is still TBC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants