mkdirp

package module
v0.0.0-...-ca11de6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2013 License: MIT Imports: 3 Imported by: 3

README

mkdirp

Make directory tree with one function call.

####Example

package "main"

import (
  "github.com/armed/mkdirp"
  "log"
)

func main() {
  err := mkdirp.Mk("/Users/armed/{somefolder1,somefolder2}/test/{data1,data2}")
  if err != nil {
    log.Fatal(err)
  }
}

Following directory tree will be created:

Users
|__armed
   |__somefolder1
   |  |__test
   |     |__data1
   |     |__data2
   |__somefolder2
      |__test
         |__data1
         |__data2

mkdirp.Mk function internally uses os.MkdirAll, and returns errors from it if any.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mk

func Mk(command string, perm os.FileMode) (err error)

Types

type TreeNode

type TreeNode interface {
	// contains filtered or unexported methods
}

type TreeRoot

type TreeRoot interface {
	TreeNode

	GetPaths() []string
	// contains filtered or unexported methods
}

func MkTree

func MkTree(command string) TreeRoot

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL