Currently, when fs.WalkDiring over a Reader there is not a good way to get the zip.File from fs.DirEntry. This does not really matter for files containing data, but currently I need to interact with directory files, specifically detect if a directory exists in the archive. Because of the virtual entries that this package adds, one must iterate over Reader.File to see if the current dfs.DirEntry exists in the zip. As such, I am left to double iterate, once with fs.WalkDir and once through Reader.File, or not use fs.WalkDir and hit Reader.File directly.
It would be nice to have zip.fileListEntry.Sys return fileListEntry.file, already an exported type zip.File, to easier interact with the underlying data, especially in my case.
package zip // import "archive/zip"
func (f *fileListEntry) Sys() interface{} { return f.file }
If one is to trust the implementation will never change, you could also abuse fileListEntry.ModTime() == time.Time{}, but this seems like a bad idea.
Currently, when
fs.WalkDiring over aReaderthere is not a good way to get thezip.Filefromfs.DirEntry. This does not really matter for files containing data, but currently I need to interact with directory files, specifically detect if a directory exists in the archive. Because of the virtual entries that this package adds, one must iterate overReader.Fileto see if the currentdfs.DirEntryexists in the zip. As such, I am left to double iterate, once withfs.WalkDirand once throughReader.File, or not usefs.WalkDirand hitReader.Filedirectly.It would be nice to have
zip.fileListEntry.SysreturnfileListEntry.file, already an exported typezip.File, to easier interact with the underlying data, especially in my case.If one is to trust the implementation will never change, you could also abuse
fileListEntry.ModTime() == time.Time{}, but this seems like a bad idea.