Code Monkey home page Code Monkey logo

symtree's Introduction

symtree

A tool to create a mirrored symlink directory tree. The main use case is when the source files have characters in their name that are not always desirable. For example, a tree of files that contain Unix valid characters (eg, :"*>) that you want to share with Windows via Samba. You can use this tool to create file names that are valid in Windows without duplicating the content.

Folders are created in the target directory. These are actual folders and not links. The files are symbolic links to the source folder. Optionally, enabled by default, a regular expression can be run on each folder and file name before the destination is created.

Usage

Basic usage python symtree.py SOURCE DEST. To mirror a folder files into a folder windows_files you would use python symtree.py files windows_files.

usage: symtree.py [-h] [-c] [-f] [-o] [-v] [-V] [--settings SETTINGS]
                  source dest

Create a mirrored folder structure with symlinked files.

positional arguments:
  source                the source directory
  dest                  the target directory, will be the highest level mirror
                        of source

optional arguments:
  -h, --help            show this help message and exit
  -c, --create          create destination if it does not exist
  -d, --disableregex    disable the usage of regular expressions
  -f, --followsymlinks  symtree will follow symbolic links for source folders
  -o, --overwritesymlinks
                        symtree will overwrite symlinks in the destination
                        directory
  -v, --verbose         verbose output
  -V, --veryverbose     insanely verbose output
  --settings SETTINGS   override the default settings file of symtree.json

Settings File

A settings file can be supplied which allows a set of regular expressions to be loaded into symtree, each of which are run on the on the file and folder names before they are linked. If an invalid setting file is provided, the default regular expression is s/<>:"\\|?*/_.

To add regular expressions to the settings file, follow this format:

"regular_expressions": {
    "<>\"\\\\|*": "_",
    "?": "",
    ":": " -"
}

symtree's People

Contributors

kaelspencer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.