ReadSubjectFile is a function that does not spark joy. It is intended to behave like a call to os.Open, except that, in certain cases, it can traverse inside a tarball and pretend that tarball is transparently part of the filesystem. Its main reason for existence is to deal with the fact that plans can refer to files that only exist inside tarred snapshots of failed tests.
This feels like a useful example of where go1.16's FS could be useful: we can write a FS that behaves like a real filesystem most of the time but, if asked to go into a directory that is actually a tarball, delegates to something like tarfs instead.
In fact, we could probably replace current read-only uses of tarballs with such an FS.
ReadSubjectFile
is a function that does not spark joy. It is intended to behave like a call toos.Open
, except that, in certain cases, it can traverse inside a tarball and pretend that tarball is transparently part of the filesystem. Its main reason for existence is to deal with the fact that plans can refer to files that only exist inside tarred snapshots of failed tests.This feels like a useful example of where go1.16's
FS
could be useful: we can write aFS
that behaves like a real filesystem most of the time but, if asked to go into a directory that is actually a tarball, delegates to something like tarfs instead.In fact, we could probably replace current read-only uses of tarballs with such an
FS
.