files109

package module
v0.0.0-...-3e46d52 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 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===
james.txt
10
109

jame1.txt
110
137

jame2.txt
138
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