fs

package
v0.0.0-...-dbec4ac Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const HomeDir = "/home/ubuntu/ECE_422_Project_1/home/"

Variables

This section is empty.

Functions

func AddGroup

func AddGroup(name string) error

func AddUser

func AddUser(username string, password string) error

func AddUserToGroup

func AddUserToGroup(username string, groupname string) error

func Authenticate

func Authenticate(username string, password string) (bool, error)

func Cat

func Cat(workingDir string, username string, filePath string) (string, error)

cat <file_name> - Show contents of file, line by line. example: "cat file1"

func Cd

func Cd(workingDir string, username string, newDir string) (string, error)

cd - Change the current directory (support ~/./..) function to get functionality this changes the 'virtual' directory - the shell directory stays the same

func GetHomeDir

func GetHomeDir(username string) (string, error)

func Ls

func Ls(workingDir string, username string) (string, error)

func Mkdir

func Mkdir(workingDir string, username string, directoryName string) (string, error)

mkdir <directory_name> - Create a new directory in current directory function to get functionality

func Mv

func Mv(workingDir string, username string, oldPath string, newPath string) (string, error)

mv <old_path> <new_path> - move a file from one location to another example: "mv /home/folder1/file1 /home/folder1/folder2/file1

func Pwd

func Pwd(workingDir string, username string) (string, error)

func Rm

func Rm(workingDir string, username string, path string) error

rm <file_name> - Delete file

func Touch

func Touch(workingDir string, username string, filename string) (string, error)

touch <file_name> - create a new file with provided name in current directory example: "touch file1"

func ValidateCheckSums

func ValidateCheckSums(username string) (string, error)

func Write

func Write(workingDir string, username string, filename string, data []byte) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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