std/io/file: new module for dealing with files
Move the functions for dealing with files out of the io package and into a new io/file package. The package should primarily have a set of functions for opening files, but can also include functions for, for example, reading directory entry names.
Similarly, add functions for seeking and other file-style stream functionality to the io package.
Waiting on #20.
Any other features this needs? Maybe an equivalent of os.OpenFile?
Here's one: Add an FS FileSystem global variable with FileSystem being something like
type FileSystem interface {
Open(path string) (File, error)
}
type File interface {
io.Reader
io.Writer
}
Or, rearrange that to have type-level differentiation between files being read and files being written.
The idea is to allow clients to swap out the FS variable to modify the way files get opened the same way that the io module has Stdin, Stdout, and Stderr variables.