Commit Graph

11 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
lixz 5b44be244d sftpfs OpenFile perm 2021-06-08 10:52:32 +08:00
lixz 5dc5331f47 sftpfs Readdirnames,Readdir 2021-05-27 15:44:56 +08:00
Mike Futerko cb1d580bf4 Fix Chown() pull request errors 2020-12-07 15:19:45 +02:00
Michail Kargakis ceb6a5e372
Merge pull request #158 from kklin/sftp-openfile
sftpfs: Implement OpenFile method
2020-04-11 00:22:21 +02:00
Michail Kargakis 90f4ffe95f
Gofmt the project 2020-04-10 23:59:22 +02:00
Bohdan Lisovskyi 30c3c32863 add chown method 2020-01-22 16:25:31 +02:00
Kevin Lin 887ec81f2f sftpfs: Implement OpenFile method
Before, the OpenFile method was unimplemented, and just returned `nil,
nil`. Because the Afero.TempFile method calls the OpenFile method, this
behavior caused a nil pointer exception when TempFile was used with
sftpfs.

This commit adds a simple implementation for sftpfs.OpenFile, fixing the
exception thrown when using it with TempFile.
2018-03-18 19:09:08 -07:00
Jerry Jacobs 81cbd6395a sftps: Fix test with latest API of the sftp package 2018-03-09 11:31:10 +01:00
Harsimran Singh Maan a1903a1b07
Keep gofmt happy 2016-11-22 22:54:07 -08:00
Cameron Moore 7711a1eb64 Move sftpfs to subpackage
* move to sftpfs subpackage

* rename sftp dir to sftpfs
* sftpfs: Add New func and clean up interface

Fixes #97 
Updates #89
2016-11-09 01:07:28 +01:00