archive/zip: expose fileListEntry.file via Sys #48084
Labels
FeatureRequest
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Currently, when
fs.WalkDir
ing over aReader
there is not a good way to get thezip.File
fromfs.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.File
to see if the currentdfs.DirEntry
exists in the zip. As such, I am left to double iterate, once withfs.WalkDir
and once throughReader.File
, or not usefs.WalkDir
and hitReader.File
directly.It would be nice to have
zip.fileListEntry.Sys
returnfileListEntry.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.The text was updated successfully, but these errors were encountered: