Mercurial > rlm
view src/rlm/sanitize_file.clj @ 3:c8e35134bf8e
working on qotd.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Wed, 18 Jan 2012 05:18:57 -0700 |
parents | 78a630e650d2 |
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))