[fd] Change where to store the pickle file

Store the fd data in $FUCHSIA_DIR/out, not /tmp.
This effectively maintains fd data per Fuchsia workspace.

Test: Confirm by running fd
 - No more fd data files in /tmp, if /tmp did not have them.
 - New fd files in $FUCHSIA_DIR/out/ when it did not have them.
 - Create $FUCHSIA_DIR/out/ when that directory did not exist.
ENPRD-3 #done

Change-Id: Ibe3b96a9f0c4c3907ba5e45c06467eb6ce0f6881
diff --git a/scripts/fd.py b/scripts/fd.py
index cb27257..919aeb2 100755
--- a/scripts/fd.py
+++ b/scripts/fd.py
@@ -9,6 +9,9 @@
 
 See examples by
 $ fd.py --help
+
+fd stores two helper files, fd.txt and fd.pickle in $FUCHSIA_DIR/out/.
+If that directory does not exists, fd will create one.
 """
 
 from __future__ import print_function
@@ -21,9 +24,9 @@
 import tty
 
 SEARCH_BASE = os.environ['FUCHSIA_DIR']  # or 'HOME'
-TMP_BASE = '/tmp/'
-DIRS_FILE = TMP_BASE + 'fd.txt'
-PICKLE_FILE = TMP_BASE + 'fd.pickle'
+STORE_DIR = SEARCH_BASE + '/out/'
+DIRS_FILE = STORE_DIR + 'fd.txt'
+PICKLE_FILE = STORE_DIR + 'fd.pickle'
 
 EXCLUDE_DIRS = [
     '"*/.git"', './build', './buildtools', './out', './third_party',
@@ -93,6 +96,9 @@
     return (r'cd {}; find . \( {} \) -prune -o -type d -print > '
             '{}').format(SEARCH_BASE, ' -o '.join(paths), DIRS_FILE)
 
+  if not os.path.exists(STORE_DIR):
+    os.makedirs(STORE_DIR)
+
   cmd_str = build_find_cmd()
   os.system(cmd_str)