Code Monkey home page Code Monkey logo

directory-tree-printer's Introduction

Directory Tree Printer

Author: Lei Mao

Date: 1/14/2018

Introduction

Printing directory tree is useful to present the direcotry architectures. Such directory trees could often be used in GitHub projects.

Dependencies

Boost C++ Library

Demo

This is the directory tree of the "Directory Tree Printer" folder.

.
├── tree.txt
├── tree_print
├── test_folder
│   ├── file1.txt
│   ├── file2.txt
│   └── folder_1
│       ├── file_3.txt
│       ├── file1.txt
│       ├── file2.txt
│       └── folder_2
│           ├── file1.txt
│           ├── file2.txt
│           └── folder_2
│               ├── file1.txt
│               ├── file2.txt
│               └── folder_2
├── tree_print.cpp
├── Makefile
├── demo
├── README.md
├── tree.h
└── tree.cpp

Usage

The executable file "tree_print" has been compiled on Ubuntu 16.04 using g++ 5.4.0. Ubuntu users should be able to use the program directly.

find . | xargs ./tree_print
find . | xargs ./tree_print > demo.txt

To compile the from the source code, simply run:

make

Caveats

The name of folder and files should not have blanks. Because the program relies on the output from find command from Linux shell, and find could not correctly parsing the directory list to the C++ program arguments, there will be problems to present the directory structure containing blanks in the path. This might be fixed in the future if I have time.

Notes

Linux has similar packages to present directory tree.

On Ubuntu:

sudo apt install tree

directory-tree-printer's People

Contributors

leimao avatar

Stargazers

Arslan Ali avatar Sihan Ma avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

adi-g15

directory-tree-printer's Issues

Using std::filesystem, and custom tokenizer

As stated in the README, the caveat (spaces in file name) can be solved using std::filesystem, if you approve of this, i would prefer working on it ?
Apart from this, boost::tokenizer<char_separator> can be replaced with a custom tokenizer function if it works well ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.