Commit Graph

364 Commits

Author SHA1 Message Date
erstam c689108954 Fix the infinite recursion by skipping the current directory in the directory names listing 2023-12-03 15:35:48 -05:00
Bjørn Erik Pedersen 5c4385aa20 github: Bump GitHub actions versions 2023-11-28 10:46:14 +01:00
Bjørn Erik Pedersen eb6bef036d github: Format workflow file 2023-11-28 10:46:14 +01:00
Bjørn Erik Pedersen 2fd19a1df9 github: Add permissions to workflow 2023-11-28 10:46:14 +01:00
Bjørn Erik Pedersen 2a63c9c2d1 deps: Update all direct dependencies
* go get $(go list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -m all)
* Update go version in go.mod to 1.19.
* go mod tidy
2023-11-28 10:46:14 +01:00
Bjørn Erik Pedersen c419971e77
github: Update Go versions 2023-11-28 10:22:52 +01:00
Tigran ee6eef77ef
Fix rename mem fs with descendants
Fixes  #141
2023-09-22 16:18:35 +02:00
Adam Munawar Rahman 45ef3465a4 Add zos build flags
Added flags to const_bsds.go and const_win_unix.go to allow for building on IBM z/OS
2023-03-06 13:24:51 +01:00
MRtecno98 18822780c0 Add sftpfs files ReadAt method 2023-03-06 13:24:11 +01:00
Bjørn Erik Pedersen d92c300a1b Fix failing tests on Windows with Go 1.20 2023-03-06 10:41:24 +01:00
Bjørn Erik Pedersen 501e8d313c Fix io.Seek* deprecation errors 2023-03-06 10:27:00 +01:00
Bjørn Erik Pedersen 1edd01aa5f Run go mod tidy 2023-03-06 10:27:00 +01:00
Graham Anderson 4ba522f8c8 fix(deps): golang.org/x/crypto, golang.org/x/text
- x/crypto - CVE-2020-9283, improper signature verification
  - x/crypto - CVE-2020-29652, nil pointer dereference
  - x/text - out of bounds read in <= v0.3.6
2023-03-06 10:27:00 +01:00
Bjørn Erik Pedersen cf95922e71 all: Run gofumpt -l -w . 2023-02-23 10:17:14 +01:00
Bjørn Erik Pedersen a6023d20a1 github: Update Go build matrix 2023-02-23 10:17:14 +01:00
Bruno Michel 3b1116bc67
memmap: Fix renaming a dir with sub-directories (#239)
Fixes ##141
2023-02-23 10:05:23 +01:00
Bjørn Erik Pedersen a800a9de53 Fix concurrency issue in MemMapFs.Mkdir/MkdirAll
* The backing map is protected by a RWMutex
* This commit double checks for the existence of the directory inside the write lock to avoid potential data races when multiple goroutines tries to create
the same directory.

Fixes #361
Fixes #298
2022-11-14 18:51:03 +01:00
Bjørn Erik Pedersen 2a70f2bb2d Make mem.File implement fs.ReadDirFile 2022-07-19 12:29:51 +02:00
Bjørn Erik Pedersen 0aa65edf44 Fix sorting in IOFS.ReadDir
We recently added a check for fs.ReadDirFile in IOFS.ReadDir, but forgot to apply a sort to the
result as defined in the spec.

This fixes that and adds a test case for it.
2022-07-19 11:13:10 +02:00
Bjørn Erik Pedersen b0a534a781
Update README.md 2022-07-14 20:00:13 +02:00
Bjørn Erik Pedersen c92ae364de Make IOFS.ReadDir check for fs.ReadDirFile
And implement `fs.ReadDirFile` for `BasePathFile`.

There are other `File` implementations that could also benefit from the above, but
this is a start.

The primary motivation behind this is to allow `fs.WalkDir` use the native
implementation whenever possible, as that new function was added in Go 1.16 with
speed as its main selling point.

This commit also adds a benchmark for `fs.WalkDir` that, when compared to the main branch:

```bash
name        old time/op    new time/op    delta
WalkDir-10     369µs ± 1%     196µs ± 3%  -46.89%  (p=0.029 n=4+4)

name        old alloc/op   new alloc/op   delta
WalkDir-10    85.3kB ± 0%    40.2kB ± 0%  -52.87%  (p=0.029 n=4+4)

name        old allocs/op  new allocs/op  delta
WalkDir-10       826 ± 0%       584 ± 0%  -29.30%  (p=0.029 n=4+4)
```

Fixes #365
2022-07-14 15:11:09 +02:00
Bjørn Erik Pedersen 52b64170ec Fix staticcheck lint errors 2022-07-14 14:33:54 +02:00
Bjørn Erik Pedersen 939bf3d6b2 Fix test failures on Windows
And also enable the CI build for Windows.
2022-07-14 13:05:08 +02:00
Bjørn Erik Pedersen 9439436a4d all: Run gofmt -s -w 2022-07-14 13:05:08 +02:00
Bjørn Erik Pedersen 015be459f3
Move CI tests to GitHub Action 2022-07-14 12:38:08 +02:00
Michalis Kargakis 100c9a6d7b
Merge pull request #346 from jeffwidman/bump-minimum-go-version
Update `go.mod` to reflect that `afero` requires `go` >= `1.15.10`
2022-04-02 00:07:27 +02:00
Jeff Widman c45d7c7cf6 Bump minimum `go` version to `1.16`
As explained in
https://github.com/spf13/afero/pull/291#issuecomment-807324649, now that
`afero` supports `io/fs.FS`, it requires `go` >= `1.15.10`.

Rather than pinning to `1.15` and occasionally confusing users who are
on < `1.15.10`, I thought simplest to jump straight to `1.16`.

Especially given `1.18` was just released, the upstream `go` team no
longer even supports `1.16`.

The change to `go.sum` was the result of running `go mod tidy`.
2022-03-16 14:41:59 -07:00
Martin Bertschler 8d9b7958ba go mod tidy 2022-03-11 11:21:15 +01:00
Martin Bertschler a2bf4c852d
Merge pull request #329 from yearnfar/master
bugfix: RemoveAll
2022-03-11 11:19:41 +01:00
Martin Bertschler 931302a103
Merge pull request #340 from typerat/fix-gcsfs-removeall-notfound
Fix gcsfs RemoveAll
2022-03-11 11:19:07 +01:00
Christoph Armster b25fb10d4f clarify error message 2022-03-10 08:24:52 +01:00
Christoph Armster d6369bbece add test for RemoveAll 2022-02-22 09:31:52 +01:00
Christoph Armster 25e8a0a4c8 fix typo 2022-02-22 09:09:00 +01:00
Christoph Armster e08384e901 return no error if file doesn't exist 2022-02-22 09:06:46 +01:00
Michalis Kargakis 450b30f2bf
Merge pull request #334 from KastenMike/add-modTime-to-folders
add modTime on folder creation
2022-02-05 11:26:56 +01:00
KastenMike 94409215e4 fix actual value in test 2022-01-10 12:00:43 +01:00
KastenMike c2c1d1206e add modTime on folder creation 2022-01-10 11:50:49 +01:00
Michalis Kargakis cd35605009
Merge pull request #332 from pojntfx/master
Call `OpenFile` instead of `Open` in `CacheOnReadFs` (fixes #193)
2022-01-05 10:12:15 +01:00
Michalis Kargakis 8298014bef
Merge pull request #306 from lixiangzhong/master
sftpfs Readdirnames,Readdir
2022-01-05 10:03:44 +01:00
lixz 4806203f28
Merge branch 'master' into master 2022-01-05 10:46:36 +08:00
Michalis Kargakis d8a4ef9d05
Merge pull request #333 from drakkan/gcsfs
GCS fs: move all gcsfs related implementations to its own package
2021-12-28 23:53:39 +01:00
Nicola Murino 165e3dc3a5 GCS fs: move all gcsfs related implementations to its own package
this way we don't force any application that import afero to include
gcfs deps in its binary
2021-12-27 18:55:57 +01:00
Felix Pojtinger 039e386d52 Call `OpenFile` instead of `Open` in `CacheOnReadFs` (fixes #193) 2021-12-25 21:19:03 +01:00
Michalis Kargakis d70f944720
Merge pull request #331 from kargakis/gcs
Add GCS Fs implementation
2021-12-22 11:09:41 +01:00
Michalis Kargakis 68b71565dd
Add README section for GCS Fs 2021-12-22 11:03:34 +01:00
Michalis Kargakis 21b977b251
Merge branch 'master' into gcs 2021-12-22 11:03:13 +01:00
yearnfar 061c13d75b bugfix: RemoveAll
when i RemoveAll lib directory, it also Removed libs directory
2021-11-15 00:13:11 +08:00
Raphael Pour 949437f3b7 Readme: fix quotes of step 3
Single quotes are reserved for runes and therefore not allowed for strings in Go: `more than one character in rune literal`
2021-11-10 15:04:45 +01:00
Michalis Kargakis f0ee686ef7
Merge pull request #312 from tklauser/bump-deps
go.mod: bump dependencies to latest version
2021-11-10 10:36:00 +01:00
Tobias Klauser d461d4f875 go.mod: bump dependencies to latest version
github.com/pkg/sftp to v1.13.1 (this fixes a security vulnerability)
golang.org/x/crypto to v0.0.0-20211108221036-ceb1ce70b4fa
golang.org/x/text to v0.3.7
2021-11-10 10:29:42 +01:00