files109

package module
v0.0.0-...-a0b00cf Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 9 Imported by: 0

README

files109

A files system demonstration for linux.

This files system is aimed at supporting unlimited files. The number of files here is dependent on the size of the files system.

Brief Description

The files system is divided into two parts: indexes and data part

Indexes Part

The indexes part looks like this for example:

===BEGIN===
data_key: james.txt
data_begin: 10
data_end: 109

data_key: jame1.txt
data_begin: 110
data_end: 137

data_key: jame2.txt
data_begin: 138
data_end: 142

===END===

The Indexes part is written to the end of the partition.

It is used to get the file contents from the data part.

Data Part

The data part has no file structure. It is written at the beginning of the partition

Documentation

Index

Constants

View Source
const (
	IndexEnd   = "===END==="
	IndexBegin = "===BEGIN==="
)

Variables

This section is empty.

Functions

func CreatePartition

func CreatePartition(linuxFolderPath, partitionName string, sizeInGBs int) error

func DeleteFile

func DeleteFile(linuxFolderPath, partitionName, name string) error

func ReadFile

func ReadFile(linuxFolderPath, partitionName, name string) ([]byte, error)

func WriteFile

func WriteFile(linuxFolderPath, partitionName, name string, data []byte) error

Types

type IndexElem

type IndexElem struct {
	FileName  string
	DataBegin int64
	DataEnd   int64
}

func ReadAllFiles

func ReadAllFiles(linuxFolderPath, partitionName string) ([]IndexElem, error)

Jump to

Keyboard shortcuts

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