Skip to content

teakopp/directory-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Directory tree

Description

A project to manage directories (without actually altering any real directories) using a series of commands.

Table of Contents

Features

  • Create, delete, move, and list directories.
  • Supports hierarchical directory structures.

Requirements

  • Python 3.x

Installation

To install this project, clone the repository and that's it! There are no external dependencies just make sure you have python 3 installed.

Steps to install Python 3

git clone https://github.com/yourusername/project-name.git
cd directory-tree

Usage

Once installed, make sure you’re in the correct directory (directory-tree) and then run the script using one of the following commands, depending on your system:

python directories.py    # For Windows or Linux
python3 directories.py   # For macOS

The following commands are available for managing the directory tree:

*Note: commands will use uppercase for first word always so create is valid as is CREATE because it makes typing the commands a little easier.

CREATE

  • Usage: CREATE <directory>
  • Description: Creates a directory at the specified path. The directory must not already exist.

MOVE

  • Usage: MOVE <source> <destination>
  • Description: Moves a directory from one location to another. Both the source and destination directories must exist.

DELETE

  • Usage: DELETE <directory>
  • Description: Deletes the specified directory. The directory must exist and cannot be the root directory.

LIST

  • Usage: LIST
  • Description: Lists all directories and their children, showing the structure in a tree-like format. Indentation indicates the depth of each directory relative to the root.

Examples:

Example 1: Create Directories

CREATE howdy
CREATE howdy/partner
CREATE hello

Example 2: Move a Directory

Move howdy/partner hello

Example 3: Delete a Directory

DELETE howdy

Example 4: List Directories

LIST

Output:

hello
howdy
  partner

Tests

To run unit tests

python -m unittest test_directories.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages