Skip to content

Releases: spf13/afero

v1.8.0: Support sftpfs.Readdirnames, sftpfs.Readdir, CacheOnReadFs bugfix

05 Jan 09:20
cd35605
Compare
Choose a tag to compare
  • sftpfs: Add support for Readdirnames and Readdir
  • CacheOnReadFs: Call OpenFile instead of Open in CacheOnReadFs.OpenFile

v1.7.1: Move GCS into its own package

28 Dec 23:00
d8a4ef9
Compare
Choose a tag to compare
Merge pull request #333 from drakkan/gcsfs

GCS fs: move all gcsfs related implementations to its own package

v1.7.0: Add experimental GCS support

22 Dec 10:18
d70f944
Compare
Choose a tag to compare

Add experimental GCS support in Afero. Experimental because the CI infra of afero does not test with real GCS buckets.

Limitations:

  • No Chmod support - The GCS ACL could probably be mapped to *nix style permissions but that would add another level of complexity and is ignored in this version.
  • No Chtimes support - Could be simulated with attributes (gcs a/m-times are set implicitly) but that's is left for another version.
  • NOTE: Not thread safe - Also assumes all file operations are done through the same instance of the GcsFs. File operations between different GcsFs instances are not guaranteed to be consistent.

Performance implications

  • Sequential reads are performant
  • Sequential writes are performant.
  • Seek + Read or ReadAt is performant after the initial seek. (produces a warning)
  • Alternating reads/writes to the same file handler are highly inefficient. To get consistent FS behavior using an API that separates readers and writers we close any open readers before an write as well close open writers before a read (ensure the data is committed).
  • Seek + Write such as WriteAt, Truncate, Seek+Write will work as expected but with significant overhead. Doing a seek + write will in effect download the old file/object, overlay it with the new writes and save it back. This is done in a streaming fashion so large files will not clog the memory but will trigger a full download and upload of the file/object.

v1.6.0: go1.16 io/fs.FS support

20 Mar 14:24
bc94f58
Compare
Choose a tag to compare
  • Add support for go1.16 io/fs.FS interface
  • Fix incorrect WriteAt implementation for mem.File

v1.5.1: Fix setting gid in chown implementation

09 Dec 12:18
32b5faa
Compare
Choose a tag to compare
Merge pull request #280 from mfuterko/master

Fix a typo

v1.5.0: Add chown support

07 Dec 19:55
816954d
Compare
Choose a tag to compare
Remove go1.13 from travis build matrix

v1.4.1: Do not panic on passing empty tar reader to tarfs

06 Oct 08:07
efa411e
Compare
Choose a tag to compare
Merge pull request #268 from hasheddan/tarfs-panic

Do not panic on passing empty tar reader to tarfs

v1.4.0: read-only tarfs implementation

14 Sep 18:46
a4ea980
Compare
Choose a tag to compare
Add tarfs implementation (reopen #265) (#266)

* Initial commit for tarfs

* tarfs: reword "open" status field

* tarfs: use TestMain for FS setup

We want to have the FS variable available through all the tests, so we
we use a common "setup" function to initialise it.

* tarfs: test: early exit for nonexisting files

* tarfs: create test for filesystem Open

* tarfs: implement File.Stat

* tarfs: implement Fs.Open

* tarfs: return error on non-supported methods

As tarfs is a read-only filesystem backend, we return EROFS (Read-only
file system) from any method that makes modifications.

* tarfs: implement File.data as bytes.Reader

Most of the operations that we want to implement for tarfs.File are
already defined in bytes.Reader.

We could use a plain slice and implement all the seeking manually, but I
think using this is more convenient.

* tarfs: short format for simple methods

* tarfs: add missing closing brace in tests

* tarfs: add test for File.ReadAt

* tarfs: test File.ReadAt

* tarfs: add tests for File.Read

* tarfs: implement File.Read

* tarfs: add tests for File.Seek

* tarfs: implement File.Seek

* tarfs: add tests for File.Name

* tarfs: implement File.Name

* tarfs: add tests for File.Close

* tarfs: implement File.Close

* tarfs: add tests for OpenFile

* tarfs: fix test for Fs.OpenFile

If the call fails, we don't have to close the file

* tarfs: remove code not needed after using filepath.Clean

* tarfs: Open: return a copy of the internal structure

As we modify the struct fields when closing, we don't want to lose the
internal representation of the file, in case we want to reopen it.

Return a copy of the File, although we keep using the same pointers to
tar.Header and buffer.Reader. Maybe we will need to change that in the
future.

* tarfs: implement Fs.OpenFile

* tarfs: use Fatalf for unexpected error in TestFsOpen

* tarfs: add tests for Fs.Stat

* tarfs: implement Fs.Stat

* tarfs: remove TestNewFs

That test depends too much on the internal imlementation, and it is
easier to break if we change it.

* tarfs: remove unused code

* tarfs: change internal implementation

To be able to handle directories (File.Readdir, File.Readdirnames), the
naive single-map implementation makes it a bit harder to implement.

Inspired by the zipfs backend, switch to an internal implementation of a
map of directories that contains a map of files, so the directory
methods are easier to implement.

Also, treat the "virtual" filesystem as absolute, just like zipfs does.

* tarfs: use Fatal errors to avoid panics

* tarfs: add pseudoroot

* tarfs: add tests for File.Readdir

* tarfs: add pointer Fs in the File structure

For directory-related operations we will need to access the internal
structure in the Fs.

As Readdir and Readdirnames are File methods, we need to access such
structure from the File.

* tarfs: fix error

* tarfs: use just the names for TestReaddir, easier than using fill os.FileInfo entries

* tarfs: create a copy of the original entry when opening a file

We added the fs field in the File struct to reference the underlying Fs
object, but in the Open cal we were not passing it, making all the
opened files to have a nil pointer in that field.

Change to make a copy of the original file, and returning that

* tarfs: implement File.Readdir

* tarfs: add tests for File.Readdirnames

* tarfs: implement Readdirnames

* tarfs: add test for File.Name

* tarfs: change tests to use the Afero interface instead

* tarfs: add tests for Glob from zipfs

* tarfs: update main repo references to tarfs

* tarfs: use OS-specific file separator for pseudoroot

* tarfs: fix path handling in Windows systems

v1.3.5: offset fixes in mem and UnionFile

02 Sep 20:10
27c9ee0
Compare
Choose a tag to compare

Includes:

  • mem: fix incorrect offset in Write
  • Fix amount of files read in UnionFile.Readdir

v1.3.4: bump golang.org/x/text to v0.3.3

09 Aug 20:34
799ff74
Compare
Choose a tag to compare