Skip to main content

Crate ebod

Crate ebod 

Source

Structs§

FileEntry
The structure with which the metadata of the files are stored, retrieved and worked upon.

Enums§

EntryType
Enum to store either the file entry is a File or a Dir (Directory).
LogType
A structure that holds the types of messages that can be displayed by the log function.

Functions§

backup
Backs up data present in the src folder into the dest folder.
check_dir_existence
check_with_filename
Checks if the filename in src already exists in the dest directory
copy_file
Abstraction for the file copying mechanism
delete_copies_in_dir
The function deletes duplicates files in the directory passed as input. Useful to clean-up duplicate files after syncing two directories.
initialize_dir
A function to initalize the directory for ebod. This is the function that is called when the ebod init command is executed. It creates the ./.ebod/metadata.json file. Scans the directory for information of files and loads the metadata into metadata.json.
log
Function with which all the progress is logged in ebod. The LogType has three options: Info, Ok and Err. Info is mapped to yellow, Ok to green and Err to red for efficient and easy to read logging.
read_metadata
Abstraction for the mechanism that reads the metadata from .ebod/metadata.json and returns it
recursive_listing
A function to traverse the directories and files recursively and store their metadata.
rename_redundant_files
Renaming redundant files to prevent overwriting
sync_dirs
The function that is called when ebod sync command is invoked. It syncs the files in the source and the destination directory. It works by first backing up the src into dest. Then dest is initialized again and then this dist is backed up into the src directory. Then the copies in the src directory are cleared to avoid duplication.