replpp.shaded.os

Members list

Type members

Classlikes

object /

Extractor to let you easily pattern match on os.Paths. Lets you do

Extractor to let you easily pattern match on os.Paths. Lets you do

 @ val base/segment/filename = pwd
 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.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
/.type
trait BasePath

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

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait BasePathImpl
class Path
class RelPath
class ResourcePath
class SubPath
trait FilePath
Show all
object BasePath

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
BasePath.type
trait BasePathImpl extends BasePath

Attributes

Supertypes
trait BasePath
class Object
trait Matchable
class Any
Known subtypes
class Path
class RelPath
class ResourcePath
class SubPath
case class CommandResult(command: Seq[String], exitCode: Int, chunks: Seq[Either[Bytes, Bytes]])

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.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait FilePath extends BasePath

Represents a value that is either an absolute Path or a relative RelPath, and can be constructed from a java.nio.file.Path or java.io.File

Represents a value that is either an absolute Path or a relative RelPath, and can be constructed from a java.nio.file.Path or java.io.File

Attributes

Companion
object
Supertypes
trait BasePath
class Object
trait Matchable
class Any
Known subtypes
class Path
class RelPath
class SubPath
object FilePath

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
FilePath.type
sealed trait FileType

Simple enum with the possible filesystem objects a path can resolve to

Simple enum with the possible filesystem objects a path can resolve to

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Dir.type
object File.type
object Other.type
object SymLink.type
object FileType

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
FileType.type

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class GlobInterpolator(sc: StringContext)

Lets you pattern match strings with interpolated glob-variables

Lets you pattern match strings with interpolated glob-variables

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Inherit the input/output stream from the current process

Inherit the input/output stream from the current process

Attributes

Supertypes
trait ProcessInput
class Object
trait Matchable
class Any
Self type
Inherit.type
object Internals

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Internals.type
object Path

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Path.type

An absolute path on the filesystem. Note that the path is normalized and cannot contain any empty "", "." or ".." segments

An absolute path on the filesystem. Note that the path is normalized and cannot contain any empty "", "." or ".." segments

Attributes

Companion
object
Supertypes
trait BasePathImpl
trait ReadablePath
trait FilePath
trait BasePath
class Object
trait Matchable
class Any
Show all
case class PathAppendRedirect(p: Path) extends ProcessOutput

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait PathChunk

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ArrayPathChunk[T]
class RelPathChunk
class SeqPathChunk[T]
class SubPathChunk
Show all
object PathChunk

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
PathChunk.type
sealed trait PathConvertible[T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object JavaIoFileConvertible.type
object NioPathConvertible.type
object StringConvertible.type
object UriPathConvertible.type

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
object PathError

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
PathError.type
case class PathRedirect(p: Path) extends ProcessInput, ProcessOutput

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ProcessInput
class Object
trait Matchable
class Any
Show all
object PermSet

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
PermSet.type
case class PermSet(value: Int)

A set of permissions; can be converted easily to the rw-rwx-r-x form via toString, or to a set of PosixFilePermissions via toSet and the other way via PermSet.fromString/PermSet.fromSet

A set of permissions; can be converted easily to the rw-rwx-r-x form via toString, or to a set of PosixFilePermissions via toSet and the other way via PermSet.fromString/PermSet.fromSet

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Pipe extends ProcessInput, ProcessOutput

Pipe the input/output stream to the current process to be used via java.lang.Process#{getInputStream,getOutputStream,getErrorStream}

Pipe the input/output stream to the current process to be used via java.lang.Process#{getInputStream,getOutputStream,getErrorStream}

Attributes

Supertypes
trait ProcessInput
class Object
trait Matchable
class Any
Self type
Pipe.type
case class PosixStatInfo(owner: UserPrincipal, permissions: PermSet)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object PosixStatInfo

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait ProcessInput

Represents the configuration of a SubProcess's input stream. Can either be os.Inherit, os.Pipe, os.Path or a os.Source

Represents the configuration of a SubProcess's input stream. Can either be os.Inherit, os.Pipe, os.Path or a os.Source

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Inherit.type
class PathRedirect
object Pipe.type
class SourceInput
object ProcessInput

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Represents the configuration of a SubProcess's output or error stream. Can either be os.Inherit, os.Pipe, os.Path or a os.ProcessOutput

Represents the configuration of a SubProcess's output or error stream. Can either be os.Inherit, os.Pipe, os.Path or a os.ProcessOutput

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Inherit.type
class PathRedirect
object Pipe.type
class ReadBytes
class Readlines
Show all
object ProcessOutput

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait ReadablePath

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Path
class ResourcePath

A relative 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.

A relative 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.

Attributes

Companion
object
Supertypes
trait BasePathImpl
trait FilePath
trait BasePath
class Object
trait Matchable
class Any
Show all
object RelPath

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
RelPath.type
case class ResourceNotFoundException(path: ResourcePath) extends Exception

Thrown when you try to read from a resource that doesn't exist.

Thrown when you try to read from a resource that doesn't exist.

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object ResourcePath

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Represents path to a resource on the java classpath.

Represents path to a resource on the java classpath.

Classloaders are tricky: http://stackoverflow.com/questions/12292926

Attributes

Companion
object
Supertypes
trait ReadablePath
trait BasePathImpl
trait BasePath
class Object
trait Matchable
class Any
Show all
sealed trait ResourceRoot

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.

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.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Class
class ClassLoader
object ResourceRoot

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait SeekableSource extends Source

A source which is guaranteeds to provide a SeekableByteChannel

A source which is guaranteeds to provide a SeekableByteChannel

Attributes

Companion
object
Supertypes
trait Source
trait Writable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait SegmentedPath extends BasePath

Attributes

Supertypes
trait BasePath
class Object
trait Matchable
class Any
Known subtypes
class RelPath
class ResourcePath
class SubPath
case class Shellable(value: Seq[String])

An implicit wrapper defining the things that can be "interpolated" directly into a subprocess call.

An implicit wrapper defining the things that can be "interpolated" directly into a subprocess call.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Shellable

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Shellable.type
trait Source extends Writable

A source of bytes; must provide either an InputStream or a SeekableByteChannel to read from. Can be constructed implicitly from strings, byte arrays, inputstreams, channels or file paths

A source of bytes; must provide either an InputStream or a SeekableByteChannel to read from. Can be constructed implicitly from strings, byte arrays, inputstreams, channels or file paths

Attributes

Companion
object
Supertypes
trait Writable
class Object
trait Matchable
class Any
Known subtypes
object Source extends WritableLowPri

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Source.type
case class StatInfo(size: Long, mtime: FileTime, ctime: FileTime, atime: FileTime, fileType: FileType)

The result from doing an system stat on a particular path.

The result from doing an system stat on a particular path.

Note: ctime is not same as ctime (Change Time) in stat, it is creation time maybe fall back to mtime if system not supported it.

Created via stat! filePath.

If you want more information, use stat.full

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object StatInfo

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
StatInfo.type

A relative path on the filesystem, without any .. or . segments

A relative path on the filesystem, without any .. or . segments

Attributes

Companion
object
Supertypes
trait BasePathImpl
trait FilePath
trait BasePath
class Object
trait Matchable
class Any
Show all
object SubPath

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
SubPath.type
class SubProcess(val wrapped: Process, val inputPumperThread: Option[Thread], val outputPumperThread: Option[Thread], val errorPumperThread: Option[Thread]) extends AutoCloseable

Represents a spawn subprocess that has started and may or may not have completed.

Represents a spawn subprocess that has started and may or may not have completed.

Attributes

Companion
object
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any
object SubProcess

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
SubProcess.type
case class SubprocessException(result: CommandResult) extends Exception

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

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Source.type
case class proc(command: Shellable*)

Convenience APIs around java.lang.Process and java.lang.ProcessBuilder:

Convenience APIs around java.lang.Process and java.lang.ProcessBuilder:

  • os.proc.call provides a convenient wrapper for "function-like" processes that you invoke with some input, whose entire output you need, but otherwise do not have any intricate back-and-forth communication

  • os.proc.stream provides a lower level API: rather than providing the output all at once, you pass in callbacks it invokes whenever there is a chunk of output received from the spawned process.

  • os.proc(...) provides the lowest level API: an simple Scala API around java.lang.ProcessBuilder, that spawns a normal java.lang.Process for you to deal with. You can then interact with it normally through the standard stdin/stdout/stderr streams, using whatever protocol you want

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Types

type Generator[+T] = Generator[T]

Value members

Concrete methods

def resource(implicit resRoot: ResourceRoot): ResourcePath

Concrete fields

val Generator: Generator.type
val home: Path

The user's home directory

The user's home directory

Attributes

val pwd: Path

The current working directory for this process.

The current working directory for this process.

Attributes

val rel: RelPath
val root: Path

The root of the filesystem

The root of the filesystem

Attributes

val sub: SubPath
val up: RelPath

Implicits

Implicits

implicit def GlobSyntax(s: StringContext): GlobInterpolator