Commit Graph

98 Commits

Author SHA1 Message Date
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
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 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
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 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
smok@google.com ebbc2020a2 Put everything in runtime/bin into '::dart::bin' namespace.
Review URL: https://codereview.chromium.org//14341015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +00:00
ajohnsen@google.com b4eacbf8aa Rename RandomAccessFile.readList and RandomAccessFile.writeList to RandomAccessFile.readInto and RandomAccessFile.writeFrom.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21466 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 15:44:41 +00:00
whesse@google.com 7e65824c01 dart:io | Add asynchronous Link.create implementation.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21077 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-08 15:12:47 +00:00
ajohnsen@google.com e75df511a6 Change how File/Directory/Link .delete works.
Now:
- File.delete works iff path is File or Link.
- Directory.delete works iff path is Directory or Link.
- Link.delete works iff path Link.

This now matches .exists.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21045 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-08 07:44:18 +00:00
sgjesse@google.com e40ce105af Fix a number of issues with determining the type of stdio
* Fix checked mode exception when _getSocketType returns an OSError
 * Treat any character device as terminal (this includes /dev/null)
 * Fix detecting of file redirection af file
 * Don't turn an unkonwn device type into an OSError (wth value for an unknown was -1)

Expanded an existing test to catch some of this.

R=ager@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20960 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 11:13:24 +00:00
whesse@google.com 2bc9a79282 Add FileSystemEntity.identical, to test if two file system objects are the same.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20307 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-21 09:44:56 +00:00
whesse@google.com 428b58d01c dart:io | Add Link.targetSync on all platforms.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20195 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 11:19:03 +00:00
whesse@google.com 2987d5397d dart:io | Add Link class, as sibling to File and Directory.
BUG=

Committed: https://code.google.com/p/dart/source/detail?r=19772
Reverted: https://code.google.com/p/dart/source/detail?r=19777

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19995 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-14 09:37:44 +00:00
whesse@google.com 43c13f4ed4 dart:io | Revert addition of Link class, because it conflicts with a Link class in dart2js.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19777 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-11 11:59:57 +00:00
whesse@google.com 31c6f8d3e5 dart:io | Add Link class, as sibling to File and Directory.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19772 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-11 10:34:52 +00:00
whesse@google.com ec7e4e5100 dart:io | Add FileSystemEntity.typeSync to test for symbolic links.
BUG=dartbug.com/8935

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19608 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-07 11:18:38 +00:00
whesse@google.com 6ef35edef1 dart:io | Rename File.name to File.path.
BUG=dartbug.com/8790

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19144 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 15:26:11 +00:00
sgjesse@google.com 488b016a2f Merge IO v2 branch to bleeding edge
R=ager@google.com, ajohnsen@google.com, whesse@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18820 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 11:58:11 +00:00
ager@google.com 67f052fa04 Add RandomAccessFile.read method and use it for file input stream.
I will deprecate the readList method completely as my next change.

R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15571 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 09:29:40 +00:00
whesse@google.com 9dfdb4850c Add a TlsSocket class to dart:io, that implements secure client sockets using TLS (SSL).
This uses the NSS (Network Security Services) libraries from Mozilla, which is a cross-platform library for SSL and TLS sockets.  We use the patched version from the Chromium repository, which is checked into third_party by the DEPS file.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14893 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-14 13:38:32 +00:00
ager@google.com 57d91e3cdc Use the encoding parameter for writeString on RandomAccessFile objects.
R=sgjesse@google.com
BUG=dartbug.com/6392

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14268 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 11:59:29 +00:00
ager@google.com d166fef422 Remove file name from File C++ structure. It is not used.
Currently, the field is being assigned a string that we
immediately deallocate leaving the field invalid. Since
it is not used we should get rid of it.

R=aprelev@gmail.com,sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14188 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 12:02:35 +00:00
ager@google.com d6fde19b9d Revert "Start adding TLS (SSL) sockets to dart:io."
Revert "Add stub for TlsSocket to dart2js library."

R=whesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10700 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 05:50:35 +00:00
whesse@google.com 5c55f1dd28 Start adding TLS (SSL) sockets to dart:io.
Add Linux implementation for SSL client sockets.

BUG=dart:3950
TEST=standalone/io/tls_socket_test

Committed: https://code.google.com/p/dart/source/detail?r=10565
Reverted: r=10567

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10650 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 14:34:02 +00:00
whesse@google.com e46ed16ce1 Revert "Start adding TLS (SSL) sockets to dart:io."
This reverts commit 10565.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10567 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 12:31:36 +00:00
whesse@google.com 7ad7023d79 Start adding TLS (SSL) sockets to dart:io.
Add Linux implementation for SSL client sockets.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10565 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 12:22:03 +00:00
ager@google.com 52230ca22b Support posting of external data into dart as external uint8 arrays through the Dart API.
The native ports use the snapshot reader to create the dart objects. Added support for reading external arrays from snapshots but no support for writing them. The only way an external array is written to a snapshot is through the api message writer.

This allows dart:io to avoid one copy of data read from files and sockets. This change only contains one use of the new API.

R=asiva@google.com,iposva@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9281 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 07:22:32 +00:00
ager@google.com 379695ee2b Implement File.lastModified.
R=sgjesse@google.com,ajohnsen@google.com
BUG=dartbug/2988
TEST=standalone/io/file*

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7945 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-24 13:10:02 +00:00
ager@google.com aba2e48950 Support length operation without opening file.
Use fstat instead of multiple seek calls to get length of
opened files.

R=sgjesse@google.com
BUG=dartbug.com/1592
TEST=standalone/io/File*Test

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6459 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-12 11:47:32 +00:00
sgjesse@google.com cdc29b23f0 Add error handling to random access file
Now all both sync and async methods on File and RandomAccessFile
should have correct error handling.

Changed readByte and readByteSync to return -1 instead of
reporting an error when end of file is reached. It seems to make
the most sense.

The amount of boiler-plate code in both the native functions and
native port functions in file.cc is growing. Maybe we should
consider some refactoring, e.g. with a table of the expected
argument types for each native port functions together with known
position of the FILE* argument.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5812 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 05:54:49 +00:00
rice@google.com 0b4c8203fc Allow std{in,out,err} to be a socket
Review URL: http://chromiumcodereview.appspot.com/9617012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5056 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 21:36:07 +00:00
sgjesse@google.com 096badbb62 Use a pool of native ports for file operations
See description on https://chromiumcodereview.appspot.com/9568010/

R=ager@google.com

BUG=none
TEST=tests/standalone/src/ManyFileOperationsTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4854 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 07:29:20 +00:00
sgjesse@google.com 5a38a88099 Port async file operations to be using native ports instead or an isolate
R=ager@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4520 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 11:11:48 +00:00
ager@google.com 7e4a36278f Implement File.directory() and File.directorySync() to get
containing directory for a file.

BUG=dart:1618
TEST=standalone/FileTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4464 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 16:18:39 +00:00
sgjesse@google.com b4d571dcdd Handle stdio redirection in standalone VM
The recent change to epoll on Linux and kqueue on Mac OS for getting
notifications from file descriptors caused the redirection of stdin,
stdout and stderr for the stand alone VM to stop working.

On Linux epoll failed when file descriptor 0, 1 or 2 redirected from
or to a file war registered. On Mac OS there was just no events
generated from kqueue.

The streams created for stdio, stdout and stderr is now of the correct
type and for file redirections no longer a socket object holding a
file descriptor for a regular file.

Added testing of stdio redirection using both pipes and files. These
tests are currently skipped on Windows.

Fixed handlin of short socket read when reading the process exit code.

Always close the socket port when not waiting for any events.

R=iposva@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4226 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-14 15:20:27 +00:00
ager@google.com d5696e2026 Change the behavior of open on files to not truncate by default
when opening for writing.

We have an explicit truncate method in the API and truncating
the file is a bit hostile to users who want to modify or append
to an existing file. :-)

R=whesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2941 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-04 12:23:01 +00:00
ager@google.com fed5e6d99c Add truncate operation to File API.
R=whesse@google.com
BUG=264
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1800 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 15:42:20 +00:00
ager@google.com eb2ed9e25f Implement delete on File objects.
R=whesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1652 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 12:27:56 +00:00
ager@google.com c4fb2b2f4d Implement setPosition on File to seek to a byte position.
R=sgjesse@google.com
BUG=dart:263
TEST=standalone/FileTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1573 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 15:50:55 +00:00
ager@google.com f74ecd22fd Implemented File create API.
R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1095 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 15:57:54 +00:00
asiva@google.com ac94efb33f Fix infinite recursion when dealing with cyclic library dependencies.
Review URL: http://codereview.chromium.org//8371016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@714 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 21:01:07 +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
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