Commit Graph

22 Commits

Author SHA1 Message Date
ajohnsen@google.com c54800f942 Give Process.kill an optional argument to specify which signal to send.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10545134

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8541 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 12:00:50 +00:00
ricow@google.com d4ec481b04 Update documentation on Process.close to explain issues with closing before reading out all content of stdout and stderr
Review URL: https://chromiumcodereview.appspot.com//10386140

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7650 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-15 11:48:10 +00:00
ager@google.com 5fb75d3952 Change dart:io to use Future for one-shot operations.
This appears to be what a lot of our users are doing and it is the
style used in our other libraries.

Noteworthy changes:

- File and Directory objects are now immutable.

- Directory.list returns an active lister object.

- Write operations on files return futures and the
  onNoPendingWrites handler is gone. The same
  functionality is there by using 'then' on the
  future returned from the last write operation.

- Process starting is now done with static methods:
  -- Process.start yields an InteractiveProcess.
  -- Process.run yields a Future<ProcessResult>

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10392023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7529 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-11 06:09:42 +00:00
sgjesse@google.com 33565cd64a Change the error handling in dart:io
1. Change the argument on all onError handlers from Exception to
Dynamic

2. Throw an exception if an error ocours and there is no error handler
present for handling it.

For sockets there is the complication that an error on a socket is
reported to the socket error handler, and each of the stream error
handlers. The solution to this is to throw an exception if there was
no error handler on either the socket or one of the streams.

Fixed a number of bugs in tests revealed by errors no longer being
silently ignored.

R=ager@google.com

BUG=none
TEST=tests/standalone/src/io/*

Review URL: https://chromiumcodereview.appspot.com//10173024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6994 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 08:12:17 +00:00
ager@google.com 493a76dd40 Support passing an environment variable map to child processes.
Fix minor type warning in test.

Reapplication after MacOS bug fix.

R=sgjesse@google.com
BUG=dartbug.com/2193
TEST=

Review URL: https://chromiumcodereview.appspot.com//10166029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6827 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-23 07:54:10 +00:00
ager@google.com c5d347fcbc Revert "Support passing an environment variable map to child processes."
Apparently the code or the test is broken on Mac.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10163004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6795 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-20 12:53:19 +00:00
ager@google.com ee81b6f0a1 Support passing an environment variable map to child processes.
Fix minor type warning in test.

R=sgjesse@google.com
BUG=dartbug.com/2193
TEST=

Review URL: https://chromiumcodereview.appspot.com//10127008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6794 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-20 12:38:57 +00:00
ager@google.com 84b0410d5a This is a request for comments.
First attempt at implementing a higher-level API for processes.
Add a startNonInteractive constructor that takes a callback which
is called with the exit code and the complete stdout and stderr
when the process terminates.

Let me know what you think. This obviously needs at least tests.
Not entirely sure what I think about the interface in the first
place.

R=sgjesse@google.com
BUG=1689
TEST=

Review URL: https://chromiumcodereview.appspot.com//9863015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6499 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 08:53:35 +00:00
ager@google.com 242bba108b Reapply dart:io API changes.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9568004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4790 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 10:07:35 +00:00
ager@google.com fd31551ca4 Revert "Rename blahHandler to onBlah throughout dart:io."
D'oh! I need to update the test binaries as well. Reverting, building
and putting back in again.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9570004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4785 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 09:43:15 +00:00
ager@google.com 40e0bceab5 Rename blahHandler to onBlah throughout dart:io.
Additionally, change all single-shot methods to take their callback as an argument instead of registering it on the object.

I have attempted to find all uses in the repo but there might
be some firefighting to do when this lands.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9500002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4784 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 09:36:04 +00:00
ager@google.com 37af08b705 Move actual work out of the SIGCHLD signal handler for the dart:io
process library.

Use the self-pipe trick to signal a dedicated thread when a SIGCHLD
signal is received. The dedicated thread will perform the actual work
of extracting the exit code and posting it back to Dart.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9293030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3711 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 09:10:24 +00:00
ager@google.com 4605b5ea33 Minor changes to the dart:io library files.
- Split some of the streams into an interface and an implementation file.
- Add documentation comments where missing.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9289042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3616 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 10:03:19 +00:00
ajohnsen@google.com c2b45bf04e Add optional workingDirectory argument to Process.start.
Review URL: http://codereview.chromium.org//9108008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2987 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-05 09:54:54 +00:00
ager@google.com 27508f3eb1 Change the process API to be completely asynchronous.
Some of the implementation is still not asynchronous but the API is
now prepared for it.

This is a breaking change for the dart test scripts. Once the
change has its final form I will add new stable builds of the
VM to the changelist for running tests.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9024008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2753 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 13:43:43 +00:00
iposva@google.com 5b509684e3 - Fix outdated use of factory clause.
- Update error messages.
Review URL: http://codereview.chromium.org//8949043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2707 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-21 17:26:02 +00:00
hausner@google.com 45fff0023d Undo some of the initializing formal change 1755
I didn't undo those initializing formas that are initializing a private field.
Review URL: http://codereview.chromium.org//8677027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1824 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 23:44:14 +00:00
hausner@google.com b9cf297c15 Initializing formals can't be optional parameters
Add new error message to VM compiler.
Remove all optional initializing formals from library
and tests.
Review URL: http://codereview.chromium.org//8619008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1755 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 19:09:54 +00:00
ager@google.com 362d04f9af Consistently use setters to set event handlers in native APIs.
R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8386029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1083 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 12:12:43 +00:00
ager@google.com 86284155b9 Improve error handling in the process library.
Verify that the arguments have the types expected by the
implementation. Require a List instance containing builtin
Strings as the arguments. Require a builtin String path.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8383037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@690 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 12:16:04 +00:00
sgjesse@google.com 17f9c619db Rename getters in process object
stdinStream -> stdin
  stdoutStream -> stdout
  stderrStream -> stderr

R=rchandia@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8359033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@602 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-21 15:22:35 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00