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

Issue 8588029: Add Directory.createTemp() to asynchronously create a temporary directory. (Closed)

Created:
9 years, 1 month ago by Bill Hesse
Modified:
9 years, 1 month ago
Reviewers:
Mads Ager (google)
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add Directory.createTemp() to asynchronously create a temporary directory. BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=1741

Patch Set 1 #

Patch Set 2 : Added Windows code. #

Total comments: 22

Patch Set 3 : Address some comments, add tests. #

Patch Set 4 : Change interface to createTemp, add tests. #

Patch Set 5 : Use snprintf. #

Total comments: 12

Patch Set 6 : Address Comments #

Patch Set 7 : Avoid test failures if /tmp does not exist. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+322 lines, -2 lines) Patch
M runtime/bin/builtin_in.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/directory.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/bin/directory.cc View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M runtime/bin/directory.dart View 1 2 3 4 5 2 chunks +21 lines, -1 line 0 comments Download
M runtime/bin/directory_impl.dart View 1 2 3 4 chunks +38 lines, -0 lines 0 comments Download
M runtime/bin/directory_posix.cc View 1 2 3 4 5 1 chunk +27 lines, -0 lines 0 comments Download
M runtime/bin/directory_win.cc View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
M tests/standalone/src/DirectoryTest.dart View 1 2 3 4 5 6 1 chunk +178 lines, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
Bill Hesse
I think I still need some error-handling code, and must add tests, and the Windows ...
9 years, 1 month ago (2011-11-17 16:46:17 UTC) #1
Mads Ager (google)
http://codereview.chromium.org/8588029/diff/2001/runtime/bin/builtin_in.cc File runtime/bin/builtin_in.cc (right): http://codereview.chromium.org/8588029/diff/2001/runtime/bin/builtin_in.cc#newcode28 runtime/bin/builtin_in.cc:28: V(Directory_CreateTemp, 2) \ Align the '\' with the other ...
9 years, 1 month ago (2011-11-18 09:50:45 UTC) #2
Bill Hesse
I think this is a lot closer. I need to test on windows, and make ...
9 years, 1 month ago (2011-11-21 15:48:41 UTC) #3
Mads Ager (google)
Much better! LGTM with a couple of comments. http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory.dart File runtime/bin/directory.dart (right): http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory.dart#newcode75 runtime/bin/directory.dart:75: * ...
9 years, 1 month ago (2011-11-21 16:29:37 UTC) #4
Bill Hesse
9 years, 1 month ago (2011-11-22 12:49:38 UTC) #5
Added fix to skip testing the /tmp directory by name, if it does not exist.

http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory.dart
File runtime/bin/directory.dart (right):

http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory.dart#...
runtime/bin/directory.dart:75: * Set the handler that is called when a temporary
directory is created.
On 2011/11/21 16:29:37, Mads Ager wrote:
> Maybe shorten this to just state that it is called when a temporary directory
is
> *successfully* created and leave out the part about the error handler?

Done.

http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory_posix.cc
File runtime/bin/directory_posix.cc (right):

http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory_posix...
runtime/bin/directory_posix.cc:272: snprintf(path,  PATH_MAX,
"/tmp/temp_dir1_XXXXXX");
On 2011/11/21 16:29:37, Mads Ager wrote:
> Remove extra space between ',' and 'PATH_MAX'.

Done.

http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory_win.cc
File runtime/bin/directory_win.cc (right):

http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory_win.c...
runtime/bin/directory_win.cc:8: #include <time.h>
On 2011/11/21 16:29:37, Mads Ager wrote:
> I don't think you need time.h now?

Done.

http://codereview.chromium.org/8588029/diff/11009/runtime/bin/directory_win.c...
runtime/bin/directory_win.cc:244: // dir_template.  Creates this directory, with
mode ???.
On 2011/11/21 16:29:37, Mads Ager wrote:
> Please fill in the mode part of the comments.

Done.

http://codereview.chromium.org/8588029/diff/11009/tests/standalone/src/Direct...
File tests/standalone/src/DirectoryTest.dart (right):

http://codereview.chromium.org/8588029/diff/11009/tests/standalone/src/Direct...
tests/standalone/src/DirectoryTest.dart:207: NestedTempDirectoryTest() {
On 2011/11/21 16:29:37, Mads Ager wrote:
> I would put the constructor before the instance methods.

Done.

http://codereview.chromium.org/8588029/diff/11009/tests/standalone/src/Direct...
tests/standalone/src/DirectoryTest.dart:217: DirectoryTest.testMain();
On 2011/11/21 16:29:37, Mads Ager wrote:
> Why not create a testMain method on NestedTempDirectoryTest instead of calling
> it from DirectoryTest.testMain. Also, I would more the code out of the
> constructor.

Done.

Powered by Google App Engine
This is Rietveld 408576698