pfi

package
v0.0.0-...-dde4a86 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SendOverNetwork determines whether the message should be send over network
	// or locally
	SendOverNetwork bool
)

Functions

func GetFuseReturnCode

func GetFuseReturnCode(retcode returncodes.Code) fuse.Status

GetFuseReturnCode from the internal return code

func StartPfi

func StartPfi()

StartPfi with given verbosity level

Types

type ParanoidFile

type ParanoidFile struct {
	Name string
	nodefs.File
}

ParanoidFile is a custom file struct with read and write functions

func (*ParanoidFile) Chmod

func (f *ParanoidFile) Chmod(perms uint32) fuse.Status

Chmod changes the permission flags of the file

func (*ParanoidFile) Read

func (f *ParanoidFile) Read(buf []byte, off int64) (fuse.ReadResult, fuse.Status)

Read reads a file and returns an array of bytes

func (*ParanoidFile) Truncate

func (f *ParanoidFile) Truncate(size uint64) fuse.Status

Truncate is called when a file is to be reduced in length to size.

func (*ParanoidFile) Utimens

func (f *ParanoidFile) Utimens(atime *time.Time, mtime *time.Time) fuse.Status

Utimens updates the access and mofication time of the file.

func (*ParanoidFile) Write

func (f *ParanoidFile) Write(content []byte, off int64) (uint32, fuse.Status)

Write writes to a file

type ParanoidFileSystem

type ParanoidFileSystem struct {
	pathfs.FileSystem
}

ParanoidFileSystem is the struct which holds all the custom filesystem functions cpssd-students provides

func (*ParanoidFileSystem) Access

func (fs *ParanoidFileSystem) Access(name string, mode uint32, context *fuse.Context) fuse.Status

Access is called by fuse to see if it has access to a certain file

func (*ParanoidFileSystem) Chmod

func (fs *ParanoidFileSystem) Chmod(
	name string, perms uint32, context *fuse.Context,
) fuse.Status

Chmod is called when the permissions of a file are to be changed

func (*ParanoidFileSystem) Create

func (fs *ParanoidFileSystem) Create(
	name string, flags uint32, mode uint32, context *fuse.Context,
) (nodefs.File, fuse.Status)

Create is called when a new file is to be created.

func (*ParanoidFileSystem) GetAttr

func (fs *ParanoidFileSystem) GetAttr(
	name string, context *fuse.Context,
) (*fuse.Attr, fuse.Status)

GetAttr is called by fuse when the attributes of a file or directory are needed. (pfs stat)

func (fs *ParanoidFileSystem) Link(
	oldName string, newName string, context *fuse.Context,
) fuse.Status

Link creates a hard link from newName to oldName

func (*ParanoidFileSystem) Mkdir

func (fs *ParanoidFileSystem) Mkdir(name string, mode uint32, context *fuse.Context) fuse.Status

Mkdir is called when creating a directory

func (*ParanoidFileSystem) Open

func (fs *ParanoidFileSystem) Open(
	name string, flags uint32, context *fuse.Context,
) (nodefs.File, fuse.Status)

Open is called to get a custom file object for a certain file so that Read and Write (among others) opperations can be executed on this custom file object (ParanoidFile, see below)

func (*ParanoidFileSystem) OpenDir

func (fs *ParanoidFileSystem) OpenDir(
	name string, context *fuse.Context,
) ([]fuse.DirEntry, fuse.Status)

OpenDir is called when the contents of a directory are needed.

func (fs *ParanoidFileSystem) Readlink(name string, context *fuse.Context) (string, fuse.Status)

Readlink to where the file is pointing to

func (*ParanoidFileSystem) Rename

func (fs *ParanoidFileSystem) Rename(
	oldName string, newName string, context *fuse.Context,
) fuse.Status

Rename is called when renaming a file

func (*ParanoidFileSystem) Rmdir

func (fs *ParanoidFileSystem) Rmdir(name string, context *fuse.Context) fuse.Status

Rmdir is called when deleting a directory

func (fs *ParanoidFileSystem) Symlink(
	oldName string, newName string, context *fuse.Context,
) fuse.Status

Symlink creates a symbolic link from newName to oldName

func (*ParanoidFileSystem) Truncate

func (fs *ParanoidFileSystem) Truncate(
	name string, size uint64, context *fuse.Context,
) fuse.Status

Truncate is called when a file is to be reduced in length to size.

func (fs *ParanoidFileSystem) Unlink(name string, context *fuse.Context) fuse.Status

Unlink is called when deleting a file

func (*ParanoidFileSystem) Utimens

func (fs *ParanoidFileSystem) Utimens(
	name string, atime *time.Time, mtime *time.Time, context *fuse.Context,
) fuse.Status

Utimens update the Access time and modified time of a given file.

Jump to

Keyboard shortcuts

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