upspin.io: upspin.io/cmd/upspinfs/internal/ose Index | Files

package ose

import "upspin.io/cmd/upspinfs/internal/ose"

Index

Package Files

ose.go

Constants

const (
    O_RDONLY = os.O_RDONLY // open the file read-only.
    O_WRONLY = os.O_WRONLY // open the file write-only.
    O_RDWR   = os.O_RDWR   // open the file read-write.
    O_APPEND = os.O_APPEND // append data to the file when writing.
    O_CREATE = os.O_CREATE // create a new file if none exists.
    O_EXCL   = os.O_EXCL   // used with O_CREATE, file must not exist
    O_SYNC   = os.O_SYNC   // open for synchronous I/O.
    O_TRUNC  = os.O_TRUNC  // if possible, truncate file when opened.

)

func Mkdir Uses

func Mkdir(name string, mode os.FileMode) error

Mkdir creates the named directory.

func MkdirAll Uses

func MkdirAll(name string, mode os.FileMode) error

MkdirAll creates the named directory and all path elements leading to it.

func Remove Uses

func Remove(name string) error

Remove removes the named file.

func RemoveAll Uses

func RemoveAll(subtree string) error

RemoveAll is a recursive remove.

func Rename Uses

func Rename(from, to string) error

Rename renames file 'from' to 'to'.

func Truncate Uses

func Truncate(name string, size int64) error

Truncate shortens a file.

type File Uses

type File struct {
    // contains filtered or unexported fields
}

File represents an encrypted file. There are no holes, in other words the disk file is not sparse.

func Create Uses

func Create(name string) (*File, error)

Create creates an encrypted file.

func OpenFile Uses

func OpenFile(name string, flag int, mode os.FileMode) (*File, error)

OpenFile opens an encrypted file.

func (*File) Close Uses

func (file *File) Close() error

Close closes a file. If the ref count goes to zero, the file is removed.

func (*File) Pin Uses

func (file *File) Pin()

Pin increases the reference count so the file will not be removed.

func (*File) ReadAt Uses

func (file *File) ReadAt(b []byte, off int64) (int, error)

ReadAt performs a random access read of an encrypted file and returns the decrypted content.

func (*File) Stat Uses

func (file *File) Stat() (os.FileInfo, error)

Stat returns the status of a file.

func (*File) WriteAt Uses

func (file *File) WriteAt(b []byte, off int64) (int, error)

WriteAt encrypts the content and writes it to the file. Unlike os.WriteAt, this changes the contents of b.

Package ose imports 8 packages (graph) and is imported by 1 packages. Updated 2019-05-09. Refresh now. Tools for package owners.