vfsutil

package
Version: v0.0.0-...-0680c3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2019 License: MIT Imports: 6 Imported by: 12

Documentation

Overview

Package vfsutil implements some I/O utility functions for webdav.FileSystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, fs webdav.FileSystem, name string) (webdav.File, error)

Create creates the named file with mode 0644 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *os.PathError.

func MkdirAll

func MkdirAll(ctx context.Context, fs webdav.FileSystem, path string, perm os.FileMode) error

MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm are used for all directories that MkdirAll creates. If path is already a directory, MkdirAll does nothing and returns nil.

func Open

func Open(ctx context.Context, fs webdav.FileSystem, name string) (http.File, error)

Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *os.PathError.

func ReadDir

func ReadDir(ctx context.Context, fs webdav.FileSystem, name string) ([]os.FileInfo, error)

ReadDir reads the contents of the directory associated with file and returns a slice of FileInfo values in directory order.

func Stat

func Stat(ctx context.Context, fs webdav.FileSystem, name string) (os.FileInfo, error)

Stat returns the FileInfo structure describing file.

func WriteFile

func WriteFile(ctx context.Context, fs webdav.FileSystem, name string, data []byte, perm os.FileMode) error

WriteFile writes data to a file named by name. If the file does not exist, WriteFile creates it with permissions perm; otherwise WriteFile truncates it before writing.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL