Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added a brief tutorial

  • Loading branch information...
commit adcda9429bf0adc0aceb7c178a3b9fba501cd76b 1 parent ebaaf3d
Philip Guo authored November 11, 2011

Showing 1 changed file with 41 additions and 0 deletions. Show diff stats Hide diff stats

  1. 41  scripts/okapi_dir.py
41  scripts/okapi_dir.py
@@ -9,6 +9,47 @@
9 9
 #
10 10
 # by Philip Guo
11 11
 
  12
+'''
  13
+A brief attempt to explain how okapi_dir.py should be used:
  14
+
  15
+argv[1] should be an ABSOLUTE PATH to a directory on your system
  16
+argv[2] can be an absolute or relative path to a directory
  17
+
  18
+okapi_dir.py copies the entire directory tree in argv[1] into argv[2],
  19
+preserving all sub-directory and symlink structure.
  20
+
  21
+For example, let's say you run:
  22
+
  23
+  mkdir /tmp/A/
  24
+
  25
+Then populate /tmp/A/ with some contents so that it looks like this:
  26
+
  27
+  /tmp/A
  28
+  /tmp/A/A-subdir
  29
+  /tmp/A/A-subdir/one.txt
  30
+  /tmp/A/A-subdir/two.txt
  31
+  /tmp/A/A-subdir/A-subsubdir
  32
+  /tmp/A/A-subdir/A-subsubdir/three.txt
  33
+
  34
+Now you run:
  35
+
  36
+  mkdir B/
  37
+
  38
+In order to copy the entirety of /tmp/A into B/, you run:
  39
+
  40
+  python CDE/scripts/okapi_dir.py /tmp/A/ B/
  41
+
  42
+and now the contents of B will look like:
  43
+
  44
+  B/tmp/A
  45
+  B/tmp/A/A-subdir
  46
+  B/tmp/A/A-subdir/one.txt
  47
+  B/tmp/A/A-subdir/two.txt
  48
+  B/tmp/A/A-subdir/A-subsubdir
  49
+  B/tmp/A/A-subdir/A-subsubdir/three.txt
  50
+
  51
+'''
  52
+
12 53
 import os, sys, subprocess
13 54
 
14 55
 def run_cmd_print_stderr(args):

0 notes on commit adcda94

Please sign in to comment.
Something went wrong with that request. Please try again.