Commit Graph

9 Commits

Author SHA1 Message Date
Oliver Bone 428eac8624
Add Chmod() method to File
`os.File` offers a `Chmod()` method. This is often safer and more direct
to use than `os.Chmod()` because it operates on an open file descriptor
rather than having to lookup the file by name. Without this, it's
possible for the target file to be renamed, in which case an
`os.Chmod()` would either fail or apply to any file that's taken its
place.

Therefore, add the `Chmod()` method to the `File` interface, and
implement it for all `File` implementations. The bulk of this change is
in `MemMapFs`, which required moving the chmod functionality down into
the `mem` package so that it can be shared between both `mem.File` and
`MemMapFs`.
2022-05-20 14:02:18 +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
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
VOvchinnikov c1220175da Added implementation to cover the new `Mkdir` & `MkdirAll` cases 2021-08-05 18:38:36 +02:00
Vasily Ovchinnikov 78acf3b074 Changed abstraction to operate on client, not bucket 2021-04-14 13:08:40 +02:00
Vasily Ovchinnikov 1a0f20777f Add GCS Fs implementation 2021-04-12 20:07:21 +02:00