Liking cljdoc? Tell your friends :D

planck.io

Planck I/O functionality.

Planck I/O functionality.

as-relative-path

(as-relative-path x)

Take an as-file-able thing and return a string if it is a relative path, else throws an exception.

Take an as-file-able thing and return a string if it is
a relative path, else throws an exception.
sourceraw docstring

Coercionsprotocol

Coerce between various 'resource-namish' things.

Coerce between various 'resource-namish' things.
as-file
(as-file x)

Coerce argument to a File.

Coerce argument to a [[File]].

as-url
(as-url x)

Coerce argument to a goog.Uri.

Coerce argument to a `goog.Uri`.

sourceraw docstring

copy

(copy input output & opts)

Copies input to output. Returns nil or throws an exception.

Input may be an planck.core/IInputStream or planck.core/IReader created using planck.io, File, or string.

Output may be an planck.core/IOutputStream or cljs.core/IWriter created using planck.io, or File.

The opts arg is included for compatibility with clojure.java.io/copy but ignored. If translating between char and byte representations, UTF-8 encoding is assumed.

Does not close any streams except those it opens itself (on a File).

Copies input to output. Returns `nil` or throws an exception.

Input may be an [[planck.core/IInputStream]] or [[planck.core/IReader]]
created using `planck.io`, [[File]], or string.

Output may be an [[planck.core/IOutputStream]] or [[cljs.core/IWriter]]
created using `planck.io`, or [[File]].

The opts arg is included for compatibility with `clojure.java.io/copy`
but ignored. If translating between char and byte representations, UTF-8
encoding is assumed.

Does not close any streams except those it opens itself (on a File).
sourceraw docstring

delete-file

(delete-file f)

Delete file f.

Delete file `f`.
sourceraw docstring

directory?

(directory? dir)

Checks if dir is a directory.

Checks if `dir` is a directory.
sourceraw docstring

exists?

(exists? f)

Checks if f exists on disk.

Checks if `f` exists on disk.
sourceraw docstring

File

source

file

(file arg)
(file parent child)
(file parent child & more)

Returns a 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.

Returns a [[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.
sourceraw docstring

file-attributes

(file-attributes path)

Returns a map containing the attributes of the item at a given path.

Returns a map containing the attributes of the item at a given path.
sourceraw docstring

file-name

(file-name x)

Returns the name (the final path element) of x.

Returns the name (the final path element) of `x`.
sourceraw docstring

file?

(file? x)

Returns true if x is a File.

Returns true if x is a File.
sourceraw docstring

hidden-file?

(hidden-file? x)

Checks if x is hidden (name starts with a . character).

Checks if `x` is hidden (name starts with a `.` character).
sourceraw docstring

input-stream

(input-stream x & opts)

Attempts to coerce its argument into an open planck.core/IInputStream.

Attempts to coerce its argument into an open [[planck.core/IInputStream]].
sourceraw docstring

IOFactoryprotocol

Factory functions that create ready-to-use versions of the various 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.

Factory functions that create ready-to-use versions of the various 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]].
make-input-stream
(make-input-stream x opts)

Creates an planck.core/IInputStream. See also IOFactory docs.

Creates an [[planck.core/IInputStream]]. See also [[IOFactory]] docs.

make-output-stream
(make-output-stream x opts)

Creates an planck.core/IOutputStream. See also IOFactory docs.

Creates an [[planck.core/IOutputStream]]. See also [[IOFactory]] docs.

make-reader
(make-reader x opts)

Creates an planck.core/IReader. See also IOFactory docs.

Creates an [[planck.core/IReader]]. See also [[IOFactory]] docs.

make-writer
(make-writer x opts)

Creates an cljs.core/IWriter. See also IOFactory docs.

Creates an [[cljs.core/IWriter]]. See also [[IOFactory]] docs.

sourceraw docstring

list-files

(list-files dir)

Returns a seq of the Files in dir or nil if dir is not a directory.

Returns a seq of the [[File]]s in dir or `nil` if dir is not a directory.
sourceraw docstring

make-parents

(make-parents f & more)

Given the same arg(s) as for file, creates all parent directories of the file they represent.

Given the same arg(s) as for [[file]], creates all parent directories of
the file they represent.
sourceraw docstring

output-stream

(output-stream x & opts)

Attempts to coerce its argument into an open planck.core/IOutputStream.

Attempts to coerce its argument into an open [[planck.core/IOutputStream]].
sourceraw docstring

path-elements

(path-elements x)

Returns the path elements of x as a sequence.

Returns the path elements of `x` as a sequence.
sourceraw docstring

read-linedeprecated

source

reader

(reader x & opts)

Attempts to coerce its argument into an open planck.core/IPushbackReader.

Attempts to coerce its argument into an open [[planck.core/IPushbackReader]].
sourceraw docstring

regular-file?

(regular-file? f)

Checks if f is a regular file.

Checks if `f` is a regular file.
sourceraw docstring

resource

(resource n)

Returns the URI for the named resource, n.

The resource must be either a JAR resource, a file resource or a "bundled" resource. JARs and files are expressed relative to the classpath while "bundled" resources are the namespaces bundled with Planck and are referred to by reference to the file that contains the namespace, eg. cljs.test is "cljs/test.cljs".

Returns the URI for the named resource, `n`.

The resource must be either a JAR resource, a file resource or a "bundled"
resource. JARs and files are expressed relative to the classpath while 
"bundled" resources are the namespaces bundled with Planck and are referred 
to by reference to the file that contains the namespace, eg. `cljs.test` is 
"cljs/test.cljs".
sourceraw docstring

slurpdeprecated

source

spitdeprecated

source

symbolic-link?

(symbolic-link? f)

Checks if f is a symbolic link.

Checks if `f` is a symbolic link.
sourceraw docstring

tty?

(tty? x)

Returns true if xis a file descriptor associated with a terminal, or x is either a Reader/Writer among *in*, *out*, or *err* which is associated with a terminal.

Returns false if x is a file descriptor, *in*, *out*, or *err* and not associated with a terminal, or an invalid file descriptor.

Returns `true` if `x `is a file descriptor associated with a terminal,
or x is either a Reader/Writer among `*in*`, `*out*`, or `*err*` which is
associated with a terminal.

Returns false if `x` is a file descriptor, `*in*`, `*out*`, or `*err*` and
not associated with a terminal, or an invalid file descriptor.
sourceraw docstring

writer

(writer x & opts)

Attempts to coerce its argument into an open cljs.core/IWriter.

Attempts to coerce its argument into an open [[cljs.core/IWriter]].
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close