GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing clojure.github.io — clojure.java.io - Clojure v1.12.4 API documentation
Clojure v1.12.4 API
Namespaces
Other Versions
Clojure Home
API for clojure.java.io - Clojure v1.12.4 (stable)by Stuart Sierra, Chas Emerick, Stuart HallowayFull namespace name: clojure.java.io OverviewThis file defines polymorphic I/O utility functions for Clojure. ProtocolsCoercionsProtocolCoerce between various 'resource-namish' things.Known implementations: java.io.File, java.lang.String, java.net.URI, java.net.URL, nil as-filefunctionUsage: (as-file x) Coerce argument to a file.Added in Clojure version 1.2 as-urlfunctionUsage: (as-url x) Coerce argument to a URL.Added in Clojure version 1.2 Source IOFactoryProtocolFactory functions that create ready-to-use, buffered versions of the various Java I/O stream types, on top of anything that can be unequivocally converted to the requested kind of stream. Common options include :append true to open stream in append mode :encoding string name of encoding to use, e.g. "UTF-8". Callers should generally prefer the higher level API provided by reader, writer, input-stream, and output-stream.Known implementations: array-of-bytes, array-of-characters, java.io.BufferedInputStream, java.io.BufferedOutputStream, java.io.BufferedReader, java.io.BufferedWriter, java.io.File, java.io.InputStream, java.io.OutputStream, java.io.Reader, java.io.Writer, java.lang.String, java.net.Socket, java.net.URI, java.net.URL, nil, Object make-input-streamfunctionUsage: (make-input-stream x opts) Creates a BufferedInputStream. See also IOFactory docs.Added in Clojure version 1.2 make-output-streamfunctionUsage: (make-output-stream x opts) Creates a BufferedOutputStream. See also IOFactory docs.Added in Clojure version 1.2 make-readerfunctionUsage: (make-reader x opts) Creates a BufferedReader. See also IOFactory docs.Added in Clojure version 1.2 make-writerfunctionUsage: (make-writer x opts) Creates a BufferedWriter. See also IOFactory docs.Added in Clojure version 1.2 Source Public Variables and Functionsas-relative-pathfunctionUsage: (as-relative-path x) Take an as-file-able thing and return a string if it is a relative path, else IllegalArgumentException.Added in Clojure version 1.2 Source copyfunctionUsage: (copy input output & opts) Copies input to output. Returns nil or throws IOException.
Input may be an InputStream, Reader, File, byte[], char[], or String.
Output may be an OutputStream, Writer, or File.
Options are key/value pairs and may be one of
:buffer-size buffer size to use, default is 1024.
:encoding encoding to use if converting between
byte and char streams.
Does not close any streams except those it opens itself
(on a File).
Added in Clojure version 1.2Source delete-filefunctionUsage: (delete-file f & [silently]) Delete file f. If silently is nil or false, raise an exception on failure, else return the value of silently.Added in Clojure version 1.2 Source filefunctionUsage: (file arg)
(file parent child)
(file parent child & more)
Returns a java.io.File, passing each arg to as-file. Multiple-arg versions treat the first argument as parent and subsequent args as children relative to the parent.Added in Clojure version 1.2 Source input-streamfunctionUsage: (input-stream x & opts) Attempts to coerce its argument into an open java.io.InputStream. Default implementations always return a java.io.BufferedInputStream. Default implementations are defined for InputStream, File, URI, URL, Socket, byte array, and String arguments. If the argument is a String, it tries to resolve it first as a URI, then as a local file name. URIs with a 'file' protocol are converted to local file names. Should be used inside with-open to ensure the InputStream is properly closed.Added in Clojure version 1.2 Source make-parentsfunctionUsage: (make-parents f & more) Given the same arg(s) as for file, creates all parent directories of the file they represent.Added in Clojure version 1.2 Source output-streamfunctionUsage: (output-stream x & opts) Attempts to coerce its argument into an open java.io.OutputStream. Default implementations always return a java.io.BufferedOutputStream. Default implementations are defined for OutputStream, File, URI, URL, Socket, and String arguments. If the argument is a String, it tries to resolve it first as a URI, then as a local file name. URIs with a 'file' protocol are converted to local file names. Should be used inside with-open to ensure the OutputStream is properly closed.Added in Clojure version 1.2 Source readerfunctionUsage: (reader x & opts) Attempts to coerce its argument into an open java.io.Reader. Default implementations always return a java.io.BufferedReader. Default implementations are provided for Reader, BufferedReader, InputStream, File, URI, URL, Socket, byte arrays, character arrays, and String. If argument is a String, it tries to resolve it first as a URI, then as a local file name. URIs with a 'file' protocol are converted to local file names. Should be used inside with-open to ensure the Reader is properly closed.Added in Clojure version 1.2 Source resourcefunctionUsage: (resource n)
(resource n loader)
Returns the URL for a named resource. Use the context class loader if no loader is specified.Added in Clojure version 1.2 Source writerfunctionUsage: (writer x & opts) Attempts to coerce its argument into an open java.io.Writer. Default implementations always return a java.io.BufferedWriter. Default implementations are provided for Writer, BufferedWriter, OutputStream, File, URI, URL, Socket, and String. If the argument is a String, it tries to resolve it first as a URI, then as a local file name. URIs with a 'file' protocol are converted to local file names. Should be used inside with-open to ensure the Writer is properly closed.Added in Clojure version 1.2 Source Copyright 2007-2025 by Rich Hickey
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |