Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Issue 52363002: dart:io | Add 'recursive' flag to File.create and Link.create. (Closed)

Created:
7 years, 1 month ago by Bill Hesse
Modified:
7 years, 1 month ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org
Visibility:
Public.

Description

dart:io | Add 'recursive' flag to File.create and Link.create. BUG=dartbug.com/12462 R=ajohnsen@google.com Committed: https://code.google.com/p/dart/source/detail?r=29563

Patch Set 1 #

Patch Set 2 : Remove recursive call to create(), simplifying control flow. #

Total comments: 15

Patch Set 3 : Address comments #

Total comments: 8

Patch Set 4 : Indentation. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+219 lines, -95 lines) Patch
M sdk/lib/io/directory_impl.dart View 1 2 1 chunk +23 lines, -45 lines 0 comments Download
M sdk/lib/io/file.dart View 1 2 1 chunk +12 lines, -2 lines 0 comments Download
M sdk/lib/io/file_impl.dart View 1 2 2 chunks +14 lines, -8 lines 0 comments Download
M sdk/lib/io/link.dart View 1 2 4 chunks +28 lines, -12 lines 0 comments Download
A tests/standalone/io/create_recursive_test.dart View 1 2 3 1 chunk +142 lines, -0 lines 0 comments Download
M tests/standalone/io/directory_test.dart View 1 2 2 chunks +0 lines, -28 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Bill Hesse
7 years, 1 month ago (2013-10-30 11:56:10 UTC) #1
Anders Johnsen
LGTM! https://codereview.chromium.org/52363002/diff/30001/sdk/lib/io/file.dart File sdk/lib/io/file.dart (right): https://codereview.chromium.org/52363002/diff/30001/sdk/lib/io/file.dart#newcode49 sdk/lib/io/file.dart:49: * components are created. Default is `false`. https://codereview.chromium.org/52363002/diff/30001/sdk/lib/io/file.dart#newcode66 ...
7 years, 1 month ago (2013-10-30 12:23:55 UTC) #2
Bill Hesse
Much better looking, thanks. https://codereview.chromium.org/52363002/diff/30001/sdk/lib/io/file.dart File sdk/lib/io/file.dart (right): https://codereview.chromium.org/52363002/diff/30001/sdk/lib/io/file.dart#newcode49 sdk/lib/io/file.dart:49: * components are created. On ...
7 years, 1 month ago (2013-10-30 15:07:36 UTC) #3
Anders Johnsen
LGTM, much better! https://codereview.chromium.org/52363002/diff/140001/sdk/lib/io/directory_impl.dart File sdk/lib/io/directory_impl.dart (right): https://codereview.chromium.org/52363002/diff/140001/sdk/lib/io/directory_impl.dart#newcode93 sdk/lib/io/directory_impl.dart:93: Future<Directory> create({bool recursive: false}) { Yay, ...
7 years, 1 month ago (2013-10-30 16:19:12 UTC) #4
Bill Hesse
Committed patchset #4 manually as r29563 (presubmit successful).
7 years, 1 month ago (2013-10-30 16:32:06 UTC) #5
Bill Hesse
7 years, 1 month ago (2013-10-30 16:51:40 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/52363002/diff/140001/sdk/lib/io/directory_imp...
File sdk/lib/io/directory_impl.dart (right):

https://codereview.chromium.org/52363002/diff/140001/sdk/lib/io/directory_imp...
sdk/lib/io/directory_impl.dart:97: if (path != parent.path) {
On 2013/10/30 16:19:13, Anders Johnsen wrote:
> Can we start with the path != parent.path, that is, before the exists test?

The path != parent.path should almost never be true.  We would have to have a
root not existing, as you point out.  And maybe we shouldn't even try to call
create, but that does return the most appropriate error.

https://codereview.chromium.org/52363002/diff/140001/tests/standalone/io/crea...
File tests/standalone/io/create_recursive_test.dart (right):

https://codereview.chromium.org/52363002/diff/140001/tests/standalone/io/crea...
tests/standalone/io/create_recursive_test.dart:135: () => link.create(temp.path,
recursive: true),
On 2013/10/30 16:19:13, Anders Johnsen wrote:
> indentation

This was intentional. An indentation over 4 spaces that lines things up is OK. 
And this is 4 spaces more than the expression that is the target of a =>.  But I
changed it to a more standard one.

Powered by Google App Engine
This is Rietveld 408576698