Break the fs package up into smaller parts.
The purpose of this is to make it easier to maintain and eventually to allow the rclone backends to be re-used in other projects without having to use the rclone configuration system. The new code layout is documented in CONTRIBUTING.
This commit is contained in:
parent
92624bbbf1
commit
11da2a6c9b
183 changed files with 5749 additions and 5063 deletions
|
@ -27,6 +27,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/ncw/rclone/fs"
|
||||
"github.com/ncw/rclone/fs/log"
|
||||
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.6
|
||||
)
|
||||
|
||||
|
@ -256,7 +257,7 @@ func (vfs *VFS) FlushDirCache() {
|
|||
// WaitForWriters sleeps until all writers have finished or
|
||||
// time.Duration has elapsed
|
||||
func (vfs *VFS) WaitForWriters(timeout time.Duration) {
|
||||
defer fs.Trace(nil, "timeout=%v", timeout)("")
|
||||
defer log.Trace(nil, "timeout=%v", timeout)("")
|
||||
const tickTime = 1 * time.Second
|
||||
deadline := time.NewTimer(timeout)
|
||||
defer deadline.Stop()
|
||||
|
@ -391,7 +392,7 @@ func decodeOpenFlags(flags int) string {
|
|||
|
||||
// OpenFile a file according to the flags and perm provided
|
||||
func (vfs *VFS) OpenFile(name string, flags int, perm os.FileMode) (fd Handle, err error) {
|
||||
defer fs.Trace(name, "flags=%s, perm=%v", decodeOpenFlags(flags), perm)("fd=%v, err=%v", &fd, &err)
|
||||
defer log.Trace(name, "flags=%s, perm=%v", decodeOpenFlags(flags), perm)("fd=%v, err=%v", &fd, &err)
|
||||
node, err := vfs.Stat(name)
|
||||
if err != nil {
|
||||
if err != ENOENT || flags&os.O_CREATE == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue