Mercurial > rlm
view src/rlm/sanitize_file.clj @ 0:78a630e650d2
initial import
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 18 Oct 2011 00:57:08 -0700 |
parents | |
children |
line wrap: on
line source
1 (ns rlm.sanitize-file2 (:import java.io.File)3 (:use clojure.contrib.str-utils))6 (defn sanitize-file-name7 "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 the11 ;; path separator.13 (re-gsub14 (re-pattern (str File/separatorChar))15 " " ;; replace "/" with " "16 name))