GoFiler is a file management system built with Go and C++. This utility allows you to create, delete, rename, move files, and much more. It even provides additional utilities for checking file system integrity, managing permissions, and inspecting disk space.
To install the GoFiler system, clone this repository to your local machine:
git clone https://github.com/Dominic-Wassef/GoFiler.gitFor the C++ version:
./GoFiler_cpp [path]For the Go version:
./GoFiler [option] [arguments]The Go codebase provides a comprehensive set of file management functionalities. It's equipped with a user-friendly CLI to perform a variety of operations such as creating, deleting, renaming and moving files, as well as reading from and writing to files.
-
main.go: This is the entry point of the Go application. It interprets command-line arguments and dispatches the appropriate file management functions. -
file_operations.go: This file provides basic file operations like creation, deletion, renaming and moving of files. -
file_management.go: This file contains more complex file management operations including directory management and file search. -
file_backup.go: This file holds functions related to backing up files, such as creating and restoring backups. -
file_compression_encryption.go: This file includes functions to compress and encrypt files, providing an additional layer of security for sensitive data. -
file_collaboration.go: This file is responsible for collaboration features, allowing multiple users to work on the same files. -
file_metadata.go: This file deals with file metadata, allowing you to read and modify information like creation date, modification date, and more.
The exact list of commands depends on the functions implemented in the respective files. For a basic example:
-
Create a new file:
-create="filename"
For example:./GoFiler -create="myfile.txt" -
Read a file:
-read="filename"
For example:./GoFiler -read="myfile.txt" -
Write to a file:
-write="filename" -data="data to write"
For example:./GoFiler -write="myfile.txt" -data="Hello, world!" -
Append to a file:
-append="filename" -data="data to append"
For example:./GoFiler -append="myfile.txt" -data="This is more data" -
Delete a file:
-delete="filename"
For example:./GoFiler -delete="myfile.txt" -
Rename a file:
-rename="oldname,newname"
For example:./GoFiler -rename="oldfile.txt,newfile.txt" -
Move a file:
-move="src,dest"
For example:./GoFiler -move="path/to/old/location.txt,path/to/new/location.txt" -
Backup a file:
-backup="filename"
For example:./GoFiler -backup="myfile.txt" -
Restore a file from backup:
-restore="filename"
For example:./GoFiler -restore="myfile.txt" -
List backups for a file:
-listBackups="filename"
For example:./GoFiler -listBackups="myfile.txt" -
Check file integrity:
-checkintegrity="filename,backupfilename"
For example:./GoFiler -checkintegrity="myfile.txt,backupfile.txt" -
Save a file:
-save="filename"
For example:./GoFiler -save="myfile.txt" -
Load a specific version of a file:
-loadVersion="filename,version"
For example:./GoFiler -loadVersion="myfile.txt,2" -
Print changes of a file:
-printChanges="filename"
For example:./GoFiler -printChanges="myfile.txt" -
Specify a user:
-user="username,role"
For example:./GoFiler -user="bob,admin" -
Assign a role to a user for a file:
-assignRole="filename" -user="username,role"
For example:./GoFiler -assignRole="myfile.txt" -user="bob,admin" -
Edit a file with user role:
-edit="filename" -data="data to append" -user="username,role"
For example:./GoFiler -edit="myfile.txt" -data="New data" -user="bob,admin" -
Compress and encrypt a file:
-compressEncrypt="filename"
For example:./GoFiler -compressEncrypt="myfile.txt" -
Decompress and decrypt a file:
-decompressDecrypt="filename"
For example:./GoFiler -decompressDecrypt="myfile.txt"
Remember that these flags should all be preceded by a hyphen (-) and the arguments should be in quotes. Multiple flags can be used at the same time, but some combinations may not make sense (like -read and -write used together).
The C++ codebase provides additional file system utilities like checking file system integrity, managing permissions, and checking disk space.
-
file_system_operations.cpp: Contains the FileSystemOperations class for performing file operations. -
file_optimization.cpp: Contains the FileOptimizer class for performing file system operations and checks.
-
CheckFileSystemIntegrity: Checks the file system integrity. -
RepairFileSystem: Repairs the file system. -
ManagePermissions: Manages the file permissions. -
CheckDiskSpace: Checks the disk space.
We provide a Makefile for building both the Go and C++ codebases:
To build both:
makeTo build the Go codebase:
make go-buildTo build the C++ codebase:
make cpp-buildTo clean the go build:
make go-cleanTo clean the cpp build:
make cpp-clean