简体   繁体   中英

Clojure, Java interop: how to get File.separator?

Somehow I can't access the path component separator character: File.separator, according to lore. These are my current imports:

(ns pcc.core
  (:require [me.raynes.fs :as fs])
  (:import java.io.File)
  (:require [clojure.java.io :as io])
  (:require [clojure.string :as string])
  (:require [clojure.tools.cli :refer [parse-opts]])
  (:gen-class))

Probably can't hit the right syntax.

To access static fields, use the / character:

user=> (java.io.File/separator)
"/"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM