A path which is either an absolute Path, a relative RelPath, or a ResourcePath with shared APIs and implementations.
A path which is either an absolute Path, a relative RelPath, or a ResourcePath with shared APIs and implementations.
Most of the filesystem-independent path-manipulation logic that lets you splice paths together or navigate in and out of paths lives in this interface
Trivial wrapper arround Array[Byte]
with sane equality and useful toString
Provides a.! b
as an alternative to the a(b)
syntax for calling a
function with one argument
Provides a! b
as an alternative to the (a(b, _)
syntax for partially
applying a function with two arguments
A staged sub-process command that has yet to be executed.
Contains the accumulated output for the invocation of a subprocess command.
Contains the accumulated output for the invocation of a subprocess command.
Apart from the exit code, the primary data-structure is a sequence of byte chunks, tagged with Left for stdout and Right for stderr. This is interleaved roughly in the order it was emitted by the subprocess, and reflects what a user would have see if the subprocess was run manually.
Derived from that, is the aggregate out
and err
StreamValues,
wrapping stdout/stderr respectively, and providing convenient access to
the aggregate output of each stream, as bytes or strings or lines.
Represents a value that is either an absolute Path or a relative ResourcePath, and can be constructed from
Simple enum with the possible filesystem objects a path can resolve to
Extends collections to give short aliases for the commonly used operations, so we can make it easy to use from the command line.
Extends collections to give short aliases for the commonly used operations, so we can make it easy to use from the command line.
A specialized Seq[Path] used to provide better a better pretty-printed experience
An absolute path on the filesystem.
An absolute path on the filesystem. Note that the path is
normalized and cannot contain any empty ""
, "."
or ".."
segments
Enforces a standard interface for constructing BasePath-like things from java types of various sorts
A set of permissions
Lets you pipe values through functions
A path that can be read from, either a Path or a ResourcePath.
A path that can be read from, either a Path or a ResourcePath. Encapsulates the logic of how to read from it in various ways.
Lets you pattern match strings with interpolated glob-variables
An absolute path on the filesystem.
An absolute path on the filesystem. Note that the path is normalized and cannot contain any empty or ".". Parent ".." segments can only occur at the left-end of the path, and are collapsed into a single number ups.
Thrown when you try to read from a resource that doesn't exist.
Classloaders are tricky: http://stackoverflow.com/questions/12292926
Represents a possible root where classpath resources can be loaded from; either a ResourceRoot.ClassLoader or a ResourceRoot.Class.
Represents a possible root where classpath resources can be loaded from; either a ResourceRoot.ClassLoader or a ResourceRoot.Class. Resources loaded from classloaders are always loaded via their absolute path, while resources loaded via classes are always loaded relatively.
An iterator that can be closed, and closes itself after you exhaust it through iteration.
An iterator that can be closed, and closes itself after you exhaust it through iteration. Not quite totally safe, since you can leak filehandles by leaving half-consumed iterators, but at least common things like foreach, mkString, reduce, sum, etc. will all result in close() being called.
An implicit wrapper defining the things that can be "interpolated" directly into a subprocess call.
Thrown when a shellout command results in a non-zero exit code.
Thrown when a shellout command results in a non-zero exit code.
Doesn't contain any additional information apart from the CommandResult that is normally returned, but ensures that failures in subprocesses happen loudly and won't get ignored unless intentionally caught
Encapsulates one of the output streams from a subprocess and provides convenience methods for accessing it in a variety of forms
An Callable1 that returns a Seq[R], but can also do so
lazily (Iterator[R]) via op.iter! arg
.
An Callable1 that returns a Seq[R], but can also do so
lazily (Iterator[R]) via op.iter! arg
. You can then use
the iterator however you wish
Kills the given process with the given signal, e.g.
Kills the given process with the given signal, e.g.
kill(9)! pid
The result from doing an system stat
on a particular path.
The result from doing an system stat
on a particular path.
Created via stat! filePath
.
If you want more information, use stat.full
Used to spawn a subprocess interactively; any output gets printed to the console and any input gets requested from the current console.
Used to spawn a subprocess interactively; any output gets printed to the
console and any input gets requested from the current console. Can be
used to run interactive subprocesses like %vim
, %python
,
%ssh "www.google.com"
or %sbt
.
Spawns a subprocess non-interactively, waiting for it to complete and collecting all output into a CommandResult which exposes it in a convenient form.
Spawns a subprocess non-interactively, waiting for it to complete and
collecting all output into a CommandResult which exposes it in a
convenient form. Call via %%('whoami).out.trim
or
%%('git, 'commit, "-am", "Hello!").exitCode
Extractor to let you easily pattern match on ops.Paths.
Extractor to let you easily pattern match on ops.Paths. Lets you do
@ val base/segment/filename = cwd base: Path = Path(Vector("Users", "haoyi", "Dropbox (Personal)")) segment: String = "Workspace" filename: String = "Ammonite"
To break apart a path and extract various pieces of it.
Lets you call FilterMapExt aliases on Arrays too
Lets you call FilterMapExt aliases on Arrays too
If you want to call subprocesses using % or %% and don't care what working directory they use, import this via
Allows you to pipe sequences into other sequences to convert them, e.g.
Allows you to pipe sequences into other sequences to convert them, e.g. Seq(1, 2, 3) |> Vector
Iternal utilities to support spawning subprocesses
Copies a file or folder from one place to another.
Copies a file or folder from one place to another. Creates any necessary directories, and copies folders recursively.
The current working directory for this process.
Checks if a file or folder exists at the given path.
Lets you treat any path as a file, letting you access any property you'd normally access through stat-ing it by stat-ing the file for you when necessary.
The user's home directory
Creates a hardlink between two paths.
Creates a hardlink between two paths. Use .s(src, dest)
to create a
symlink
List the files and folders in a directory.
List the files and folders in a directory. Can be called with .iter
to return an iterator, or .rec
to recursively list everything in
subdirectories. .rec
is a ls.Walker which means that apart from
straight-forwardly listing everything, you can pass in a skip
predicate
to cause your recursion to skip certain files or folders.
Makes directories up to the specified path.
Makes directories up to the specified path. Equivalent
to mkdir -p
in bash
Moves a file or folder from one place to another.
Moves a file or folder from one place to another.
Creates any necessary directories
Reads a file into memory, either as a String, as (read.lines(...): Seq[String]), or as (read.bytes(...): Array[Byte]).
Roughly equivalent to bash's rm -rf
.
Roughly equivalent to bash's rm -rf
. Deletes
any files or folders in the target path, or
does nothing if there aren't any
The root of the filesystem
Alias for java.nio.file.Files.createTempFile
and
java.io.File.deleteOnExit
.
Alias for java.nio.file.Files.createTempFile
and
java.io.File.deleteOnExit
. Pass in deleteOnExit = false
if you want
the temp file to stick around.
Write some data to a file.
Write some data to a file. This can be a String, an Array[Byte], or a Seq[String] which is treated as consecutive lines. By default, this fails if a file already exists at the target location. Use write.over or write.append if you want to over-write it or add to what's already there.