John McCutchan
28e416b1f4
Revert "Avoid strerror_r portability issues"
...
This reverts commit ca81c1732b .
2015-11-17 16:34:25 -08:00
John McCutchan
ca81c1732b
Avoid strerror_r portability issues
...
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1450113003 .
2015-11-17 15:23:47 -08:00
Søren Gjesse
eaeecf2ed1
Add file modes for opening a file write only
...
Added two new file modes WRITE_ONLY and WRITE_ONLY_APPEND. The current
file modes WRITE and WRITE_APPEND are kept as the read/write mode with
no change. Kept the same overall handling of create/truncate/append
semantics for the new file modes.
R=ager@google.com , ahe@google.com
BUG=
Review URL: https://codereview.chromium.org//1193653002 .
2015-06-18 15:19:26 +02:00
sgjesse@google.com
218e366f89
Add support for file locking
...
This adds support for file locking in dart:io.
BUG=http://dartbug.com/17045
R=kustermann@google.com , lrn@google.com
Review URL: https://codereview.chromium.org//833623004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42733 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-09 13:06:37 +00:00
ajohnsen@google.com
7aed60d005
Show actualy FD for files in Observatory.
...
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//296403005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36656 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 09:18:43 +00:00
ajohnsen@google.com
b8668cd8bc
Revert to using second-precision on file timestamps on Android.
...
BUG=
R=zra@google.com
Review URL: https://codereview.chromium.org//254043002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35535 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-29 18:32:02 +00:00
ajohnsen@google.com
3265fb5d09
Make FileStat have millisecond precisions, for linux, mac and android.
...
BUG=https://code.google.com/p/dart/issues/detail?id=18442
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//252123005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35520 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-29 11:38:50 +00:00
ajohnsen@google.com
82f487f92f
Fix File:copy FD leak, and add file-closes to some tests.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//233053004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34961 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-11 07:48:49 +00:00
ajohnsen@google.com
0c157cd31e
Move signal_blocker to platform and use it by default in TEMP_FAILURE_RETRY.
...
BUG=http://code.google.com/p/dart/issues/detail?id=16927
R=johnmccutchan@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//165723007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33745 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 13:51:11 +00:00
ajohnsen@google.com
0f52be7f63
Make std* blocking file-descriptors.
...
This will most likely be a performance regression when piping, that
we'll have to look into in the future (copying data through
message-passing).
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//154273003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32715 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-17 10:06:35 +00:00
iposva@google.com
781f737c6a
First round of http://dartbug.com/15922 :
...
- Address warnings about 64-bit to 32-bit conversions.
- Remove heap profiler.
R=asiva@google.com
Review URL: https://codereview.chromium.org//139043003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31867 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 05:05:35 +00:00
johnmccutchan@google.com
919dc2d6eb
* Introduce ThreadInterrupter which calls a TLS set callback when thread is interrupted.
...
* Threads can only register and unregister themselves with ThreadInterrupter.
* Profiler is no longer involved in interrupting threads. It's just a callback and the buffer.
* Profiler operates lock free using an atomic operation to reserve sample in sample buffer.
* Linux, Mac, and Windows done.
R=asiva@google.com
Review URL: https://codereview.chromium.org//109803002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31170 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-16 18:52:15 +00:00
ajohnsen@google.com
33560b188f
Add comment to File copy on linux/android.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//102663005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31155 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-16 09:12:48 +00:00
zra@google.com
b7dcef91bb
Fixes build of file_android.cc.
...
Android sendfile takes an off_t offset rather than off64_t.
Review URL: https://codereview.chromium.org//109223005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31147 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-13 20:40:33 +00:00
ajohnsen@google.com
0b2c1db64a
Add fallback-implementation for sendfile on linux and android.
...
BUG=
Review URL: https://codereview.chromium.org//99583008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31134 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-13 14:18:11 +00:00
ajohnsen@google.com
9095324cf6
Fix 64-bit linux build after file-copy change.
...
BUG=
Review URL: https://codereview.chromium.org//115183002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31129 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-13 12:42:14 +00:00
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
ajohnsen@google.com
545455cccb
Undo some of the large-file changes on Android, as only some of them are implemented.
...
BUG=
R=zra@google.com
Review URL: https://codereview.chromium.org//76413003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30415 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 16:24:10 +00:00
ajohnsen@google.com
7fef1ff77a
Add support for working with large files on unix systems, in dart:io.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//63363010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30399 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 11:38:20 +00:00
cbracken@google.com
a6ace331f3
Replaced strerror() calls with threadsafe strerror_r().
...
Mac/Android use the XSI-compliant definition of strerror_r() which stores the message in the passed-in buffer.
Linux uses the GNU-specific definition of strerror_r() which takes a buffer and returns the message in a char* (which may or may not be the passed-in buffer).
BUG=
R=iposva@google.com
Review URL: https://codereview.chromium.org//22634003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25943 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 20:24:05 +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
whesse@google.com
9c6d3b86e4
dart:io | Make FileStat.stat throw an exception when the file does not exist, or cannot be accessed.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//16140008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23543 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-03 15:01:02 +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
a76b78a26e
dart:io | Fix a few bugs in the Android port of dart:io.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//15894004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23260 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 12:58:30 +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
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
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
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
iposva@google.com
9046a44a37
Prepare for removal of source_filter.gypi:
...
- Guard OS-dependent source files with #if TARGET_OS_* in a similar
fashion to the architecture dependent sources.
Review URL: https://codereview.chromium.org//12282051
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18786 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 21:17:38 +00:00
gram@google.com
3601944836
Revised CL for customisable logging (replacing printfs).
...
Review URL: https://codereview.chromium.org//11312242
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15096 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 17:38:15 +00:00
kustermann@google.com
fb093fd342
Added O_CLOEXEC to the flags parameter of open() calls
...
To prevent sub-processes from inheriting open file descriptors of
the current process, the O_CLOEXEC flag is necessary.
Review URL: https://codereview.chromium.org//11419008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14963 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 13:46:15 +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
jackpal@google.com
e060b66a3e
Add _android files for building DartVM on Android
...
Split directory_posix -> directory_(android|linux|macos)
This allows us to cleanly make Android-specific changes to
directory_android.cc
Copy all _linux files to _android files and edit as needed to account
for the differences between Linux and Android:
+ getcwd(0, NULL) doesn't work on Android, have to emulate
+ Android doesn't have a '/tmp' directory, have to emulate
+ Android doesn't provide mkdtemp(), have to emulate.
+ Small differences in the available system include files.
+ Use pthread_cond_timedwait_monotonic instead of
pthread_condattr_setclock
Review URL: https://chromiumcodereview.appspot.com//10826233
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10613 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 23:06:52 +00:00