view src/rlm/sanitize_file.clj @ 4:12d1367cf1aa

updating various utilities
author Robert McIntyre <rlm@mit.edu>
date Thu, 01 Mar 2012 05:47:23 -0700
parents 78a630e650d2
children
line wrap: on
line source
1 (ns rlm.sanitize-file
2 (:import java.io.File)
3 (:use clojure.contrib.str-utils))
6 (defn sanitize-file-name
7 "given a file name, convert it into a valid file name.
8 currently only works for linux"
9 [#^String name]
10 ;; as far as I know, all that must be done is removal of the
11 ;; path separator.
13 (re-gsub
14 (re-pattern (str File/separatorChar))
15 " " ;; replace "/" with " "
16 name))