• Modules
    • By category
    • By name
    • Most popular
    • Most downloaded
    • Repository
  • Register
  • Log in
  • Help
    • Start using Ceylon Herd
    • Publish your first module
    • Module publishing guidelines
    • All about Ceylon
    • Keyboard Shortcuts

    • s Focus search module bar
      ? Open this information panel
      j Move selection down
      k Move selection up
      enter Open current selection
Module info
Name
gavin / ceylon.process
Ceylon Process Platform Module
Description

API for running native commands in a child process. Clients simply create Processes using the createProcess() method. The new process starts executing immediately.

Process process = createProcess { 
    command = "ls";
    arguments = ["-l"];
    path = home;
};

By default, the standard input, output, and error streams of the new child process are piped to and from the current process by exposing a Writer and Readers.

if (is Reader reader = process.output) {
    while (exists line = reader.readLine()) {
        print(line);
    }
}

The standard input, output, and error streams may be redirected by specifying an Input or Output to createProcess().

Process process = createProcess {
    command = "ls";
    arguments = ["-l"];
    path = home;
    output = OverwriteFileOutput {
        path = home.childPath("out.txt");
    };
    error = AppendFileOutput {
        path = home.childPath("err.txt");
    };
};

The objects currentInput, currentOutput, and currentError allow the standard input, output, and error streams to be redirected to the standard input, output, and error streams of the current virtual machine process.

Process process = createProcess {
    command = "ls";
    arguments = ["-l"];
    path = home;
    output = currentOutput;
    error = currentError;
};

To wait for the child process to terminate, call the waitForExit() method of Process.

Category SDK

The Ceylon SDK

Last Published Aug 21, 2017
Stats Downloads (JVM): 13057
Downloads (JS): 0
Source downloads: 9332
Module links Home
Code repository
Issue tracker
Imported By
Browse
List of published versions
1.3.3 JVM JVM: 1.2.x, 1.3.x (latest) Published Aug 21, 2017 Browse
View docs
1.3.2 JVM JVM: 1.2.x, 1.3.x (latest) Published Mar 1, 2017 Browse
View docs
1.3.1 JVM JVM: 1.2.x, 1.3.x (latest) Published Nov 21, 2016 Browse
View docs
1.3.0 JVM JVM: 1.2.x, 1.3.x (latest) Published Sep 15, 2016 Browse
View docs
1.2.2 JVM JVM: 1.2.x, 1.3.x (latest) Published Mar 11, 2016 Browse
View docs
1.2.1 JVM JVM: 1.2.x, 1.3.x (latest) Published Feb 11, 2016 Browse
View docs
1.2.0 JVM JVM: 1.2.x, 1.3.x (latest) Published Oct 28, 2015 Browse
View docs
1.1.0 JVM JVM: 1.1.0 (outdated) Published Oct 8, 2014 Browse
View docs
1.0.0 JVM JVM: 1.0.0 (outdated) Published Nov 11, 2013 Browse
View docs
0.6.1 JVM JVM: M6 (outdated) Published Sep 24, 2013 Browse
View docs
0.6 JVM JVM: M6 (outdated) Published Sep 20, 2013 Browse
View docs
0.5 JVM JVM: M5 (outdated) Published Mar 14, 2013 Browse
View docs
0.4 JVM JVM: M4 (oudated) Published Oct 29, 2012 Browse
View docs
0.3.2 JVM JVM: M3.1 (outdated) Published Jul 6, 2012 Browse
View docs
0.3.1 JVM JVM: M3 (outdated) Published Jun 22, 2012 Browse
View docs
You must be logged in to comment.

Ceylon Herd v1.24 Copyright 2012-2023 Red Hat. About