Commit graph

94 commits

Author SHA1 Message Date
ajohnsen@google.com fe6b63d5e4 Add File.copy(Sync) to dart:io.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//105133004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31125 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-13 12:04:24 +00:00
johnniwinther@google.com 8541952510 Implement least upper bound.
As a side-effect disallow multiple inheritance with different type arguments.

R=karlklose@google.com

Review URL: https://codereview.chromium.org//52263003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30661 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-26 08:32:08 +00:00
sgjesse@google.com 0aa1345b12 Add optional flush argument to some file methods
BUG=http://dartbug.com/8794

R=whesse@google.com, ajohnsen@google.com

Review URL: https://codereview.chromium.org//20745006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29880 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 08:46:50 +00:00
whesse@google.com 1e3b58ade0 dart:io | Add 'recursive' flag to File.create and Link.create.
BUG=dartbug.com/12462
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//52363002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29563 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 16:31:53 +00:00
ajohnsen@google.com 253ad80d88 Don't close the _FileStream until all operations are done.
BUG=

Review URL: https://codereview.chromium.org//48113028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29541 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 13:15:32 +00:00
ajohnsen@google.com 7338c0c409 Fix File.openStream where it sometimes would keep the file open.
BUG=

Review URL: https://codereview.chromium.org//46073003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29539 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 12:38:00 +00:00
lrn@google.com f0a1c922a2 Reapply "Remove @deprecated features."
R=scheglov@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//50413005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29535 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 12:09:15 +00:00
ajohnsen@google.com 09e82e02be Let the stream of File:openRead handle cancel correctly.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//51883004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29534 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 11:44:06 +00:00
ajohnsen@google.com 103eac574c Remove FileException, DirectoryException and LinkException from dart:io and use FileSystemException instaed.
BUG=https://code.google.com/p/dart/issues/detail?id=12461
R=nweiz@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//26968003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29168 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 12:17:20 +00:00
whesse@google.com bfc3d53dc6 dart:io | Add FileSystemEntity.parent, make File.directory call it.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//26001002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28986 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 07:32:06 +00:00
floitsch@google.com 4be547c705 Adapt streams for additional stackTrace argument.
R=lrn@google.com

Review URL: https://codereview.chromium.org//25094002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28511 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-11 12:02:20 +00:00
ajohnsen@google.com 8323221e70 Only allow one async operation on RandomAccessFile at a time.
This is to make sure we never have a race-condition on the same
File*/FD. For a File it should be fine, as each operation will open it's
own FD to work on.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//24721003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28088 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 11:23:32 +00:00
ajohnsen@google.com 7e75589a5d Fix File stream on cancel.
Before we could end up having both an issued read and a close request.
Given the new nature of our io-service, this could lead to a race
condition between the two.

BUG=https://code.google.com/p/dart/issues/detail?id=12982
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//24667003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27955 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-26 14:34:15 +00:00
ajohnsen@google.com 3e0a59b920 Clean up IOService implementation to be shared between patched and non-patched code.
BUG=

Review URL: https://codereview.chromium.org//24596003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27888 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 15:53:54 +00:00
ajohnsen@google.com a347038cd7 Merge services into a shared IOService in dart:io, and use a native port.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//24395013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27883 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 15:03:24 +00:00
whesse@google.com 4fc5c84809 Recommit add FileSystemEntity.resolveSymbolicLinks
This was reverted in r27481 because of a failure on the debug Windows VM buildbot.

BUG=dartbug.com/1016

Review URL: https://codereview.chromium.org//23480093

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27612 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-18 12:29:47 +00:00
whesse@google.com 31c85401eb Revert "dart:io | Change File.fullPath to FileSystemEntity.resolveSymbolicLinks."
This reverts commit r27475.

BUG=dartbug.com/1016

Review URL: https://codereview.chromium.org//23658048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27481 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-13 15:00:26 +00:00
whesse@google.com f9ba5f494d dart:io | Change File.fullPath to FileSystemEntity.resolveSymbolicLinks.
BUG=dartbug.com/1016
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//23444037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27475 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-13 11:15:12 +00:00
whesse@google.com ca27ddeafe Add FileSystemEntity.absolutePath and .isAbsolute properties.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//23468027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27467 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-13 08:56:16 +00:00
ajohnsen@google.com b57176ef54 Throw FileExceptions when in File when reading as String and decoding fails.
BUG=https://code.google.com/p/dart/issues/detail?id=13199
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//23953004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27329 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-10 11:14:31 +00:00
ajohnsen@google.com 47239cb3a2 Move delete/deleteSync up to FileSystemEntity, with a shared documentation.
This also means that FileSystemEntity.delete(recursive: true) now will
delete any object on disk, much like 'rm -r', without the need of
wrapping it in a Directory object.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//23889008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27196 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 14:54:38 +00:00
ajohnsen@google.com 38bae0af02 Add FileSystemWatcher class to dart:io.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//19263003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27048 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 12:43:08 +00:00
floitsch@google.com 35d7140e66 Remove Encoding-enum from dart:io and add interface in dart:convert.
BUG= http://dartbug.com/6284
BUG= http://dartbug.com/7966
R=nweiz@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//22872012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26632 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 10:37:25 +00:00
sgjesse@google.com 38506f9d57 Remove the LineTransformer from dart:io
The LineTransformer has been retired, and is replaced with LineSplitter from dart:convert

R=floitsch@google.com, nweiz@google.com

Review URL: https://codereview.chromium.org//22927016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26419 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 07:35:46 +00:00
sgjesse@google.com 353428a918 Remove the Path class from dart:io
The Path class in dart:io has been deprecated for some time
now. It was scheduled to be removed on August 11th, so here it
goes.

dart:io still uses the Path class internally, but now it is
private. I will trim it down to what is actually used in a
follow-up change.

R=ahe@google.com, devoncarew@google.com, whesse@google.com
BUG=http://dartbug.com/11666

Review URL: https://codereview.chromium.org//23054008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26181 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-15 10:10:53 +00:00
whesse@google.com 48cf6c5ebd Fix some analyzer warnings in dart:io.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//22893005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26051 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 14:11:33 +00:00
sgjesse@google.com f01310ef85 Add argument check to Directory and Link constructors
These matches the argument check in the File constructor.

Minor refactoring of final fields in File and Directory implementations.

BUG=http://dartbug.com/11976

R=whesse@google.com

Review URL: https://codereview.chromium.org//21520002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25705 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-01 11:32:19 +00:00
ajohnsen@google.com f7d1f50329 Remove _BufferList from dart:io and now use BytesBuilder.
BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org//18031023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24941 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 10:39:02 +00:00
asiva@google.com 1e0c98714b Make writes consistent across socket and file synchronous/asynchronus writes in terms of truncation semantics (reports an argument error if the list element contains a non byte value).
Remove Common_IsBuiltinList as it is not used anymore

Change synchronous file writes to use Dart_TypedDataAcquireData and
Dart_TypedDataReleaseData since the buffer object is always a Uint8List
instead of the more expensive Dart_ListGetAsBytes.

R=ajohnsen@google.com, iposva@google.com

Review URL: https://codereview.chromium.org//18115002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24620 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-29 18:19:33 +00:00
ajohnsen@google.com f6b8d89968 Add FileException.path and clean up file exceptions.
Now correctly throw ArgumentError and not delayed FileExceptions in case
of invalid arguments.

BUG=https://code.google.com/p/dart/issues/detail?id=3075

Review URL: https://codereview.chromium.org//18090003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24523 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 16:42:32 +00:00
sgjesse@google.com 78e9b8ef87 dart:io | Add rename to Link
R=whesse@google.com
BUG=

Review URL: https://codereview.chromium.org//17848003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24468 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-26 14:09:29 +00:00
sgjesse@google.com 7ce40aa3a0 dart:io | Add File.rename
R=ajohnsen@google.com
BUG=

Committed: https://code.google.com/p/dart/source/detail?r=24029

Review URL: https://codereview.chromium.org//17033003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24030 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 13:34:54 +00:00
sgjesse@google.com 55709f1f43 Ensure that only byte values are sent by sockets and web sockets
R=ajohnsen@google.com
BUG=http://dartbug.com/11007

Review URL: https://codereview.chromium.org//16363005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23896 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 08:33:16 +00:00
ajohnsen@google.com 5ce3b9ddea Clean up dart:io exceptions.
- Introduce IOException.
- Remove HttpParserException.
- Merge RedirectLimitExceededException and RedirectLoopException into
RedirectException.
- Remove 'IO' from FileIOException, DirectoryIOException, LinkIOException
and SocketIOException.

BUG=https://code.google.com/p/dart/issues/detail?id=9955
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//16123036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23848 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 13:15:46 +00:00
whesse@google.com 180e054164 dart:io | Add .stat() and .statSync() to FileSystemEntity and subclasses File, Directory, and Link.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//16156009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23540 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-03 12:41:30 +00:00
lrn@google.com faa7227cec Make new StreamController be async by default.
Change all instances, except some tests, to be sync still.
Rename Multiplex to Broadcast everywhere.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//16125005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23453 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 06:07:39 +00:00
sgjesse@google.com 7841206de5 Change File.directory to not do any IO
Removed the File.directory and File.directorySync methods and added a
File.directory getter. The File.directory getter does not do any IO,
but just calculates the directory of the file from the path.

R=whesse@google.com
BUG=http://dartbug.com/9926

Review URL: https://codereview.chromium.org//15832003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23349 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 12:38:27 +00:00
johnniwinther@google.com 71bfc2d935 Type check try statements
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//15689009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23220 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 12:47:28 +00:00
ajohnsen@google.com f06faf4a48 Remove explicit delayed futures in dart:io.
After the change of Completers always being delayed to the next tick,
      this is no longer needed.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//15680002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22984 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-22 07:23:18 +00:00
ajohnsen@google.com d19cfb48ec Ensure to close file-stream on all errors.
BUG=

Review URL: https://codereview.chromium.org//15337005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22932 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-21 11:11:49 +00:00
ajohnsen@google.com 919ece9a32 Add 'start' and 'end' optional arguments to File.openRead(). This makes it possible to stream a sub-range of a file.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//15547003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22922 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-21 09:22:24 +00:00
whesse@google.com fb8471244f dart:io | Add FileSystemEntity.stat() and FileStat class.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//15018011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22685 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 16:26:13 +00:00
whesse@google.com 563f4ee333 dart:io | Improve text of FileIOException on File.exists().
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//14737005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22418 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-06 15:21:07 +00:00
whesse@google.com 0ae62a79dc dart:io | Implement truly asynchronous version of FileSystemEntity.type().
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//14907002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22364 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 12:02:10 +00:00
whesse@google.com 396011beae dart:io | Add asynchronous versions of the methods of FileSystemEntity and Link.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//14642012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22354 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 08:39:16 +00:00
ajohnsen@google.com 2426d152d4 Don't use length when reading a file in chunks (but continue to EOF).
BUG=http://code.google.com/p/dart/issues/detail?id=10381
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//14611007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22314 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-02 11:42:39 +00:00
ajohnsen@google.com 6f81bd5427 Re-write _BufferList to keep an internal Uint8List buffer, that will grow on demand.
This eliminates a lot of the performance issues seen with _BufferList.
We now do either setRange if it's Uint8List, or a fast iteration for any
other list (in case of e.g. CodeUnits).

BUG=

Review URL: https://codereview.chromium.org//14057010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21679 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 16:22:16 +00:00
floitsch@google.com 466d6670c1 Refactor Future constructors.
BUG=

Review URL: https://codereview.chromium.org//14070010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21517 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 21:24:27 +00:00
floitsch@google.com 5431a5af54 Remove AsyncError with Expando.
Review URL: https://codereview.chromium.org//14251006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21498 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 18:58:32 +00:00
floitsch@google.com f553392322 Change StreamController constructor.
Review URL: https://codereview.chromium.org//14196003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21472 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 16:34:26 +00:00