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

Issue 13654002: Change how File/Directory/Link .delete works. (Closed)

Created:
7 years, 8 months ago by Anders Johnsen
Modified:
7 years, 8 months ago
CC:
reviews_dartlang.org, Mads Ager (google)
Visibility:
Public.

Description

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= Committed: https://code.google.com/p/dart/source/detail?r=21045

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 18

Patch Set 4 : Review fixes #

Patch Set 5 : Fix windows. #

Patch Set 6 : #

Total comments: 6

Patch Set 7 : Fix windows error codes. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+816 lines, -73 lines) Patch
M runtime/bin/builtin_natives.cc View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/directory_android.cc View 1 2 3 4 5 2 chunks +10 lines, -2 lines 0 comments Download
M runtime/bin/directory_linux.cc View 1 2 3 4 5 2 chunks +10 lines, -2 lines 0 comments Download
M runtime/bin/directory_macos.cc View 1 2 3 4 5 2 chunks +10 lines, -2 lines 0 comments Download
M runtime/bin/directory_win.cc View 1 2 3 4 5 6 6 chunks +37 lines, -14 lines 0 comments Download
M runtime/bin/file.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M runtime/bin/file.cc View 1 2 3 3 chunks +33 lines, -0 lines 0 comments Download
M runtime/bin/file_android.cc View 1 2 3 4 5 1 chunk +18 lines, -4 lines 0 comments Download
M runtime/bin/file_linux.cc View 1 2 3 1 chunk +18 lines, -4 lines 0 comments Download
M runtime/bin/file_macos.cc View 1 2 3 4 5 1 chunk +18 lines, -4 lines 0 comments Download
M runtime/bin/file_patch.dart View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/file_win.cc View 1 2 3 4 5 6 3 chunks +24 lines, -29 lines 4 comments Download
M sdk/lib/io/file_impl.dart View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/io/link.dart View 1 2 3 4 5 4 chunks +31 lines, -7 lines 0 comments Download
A tests/standalone/io/file_system_delete_test.dart View 1 2 3 4 5 1 chunk +393 lines, -0 lines 0 comments Download
A tests/standalone/io/file_system_exists_test.dart View 1 2 3 4 5 1 chunk +204 lines, -0 lines 0 comments Download
M tests/standalone/io/file_system_links_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/windows_file_system_links_test.dart View 1 2 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Anders Johnsen
Mac and Android will follow once LGTM, as they are both copies of Linux. It's ...
7 years, 8 months ago (2013-04-05 11:21:25 UTC) #1
Søren Gjesse
This is looking good. We need to figure out how to report errors when deleting ...
7 years, 8 months ago (2013-04-05 12:52:49 UTC) #2
Anders Johnsen
PTAL https://codereview.chromium.org/13654002/diff/5001/runtime/bin/directory_win.cc File runtime/bin/directory_win.cc (right): https://codereview.chromium.org/13654002/diff/5001/runtime/bin/directory_win.cc#newcode432 runtime/bin/directory_win.cc:432: } On 2013/04/05 12:52:50, Søren Gjesse wrote: > ...
7 years, 8 months ago (2013-04-08 06:50:49 UTC) #3
Søren Gjesse
LGTM!! https://codereview.chromium.org/13654002/diff/16001/runtime/bin/directory_win.cc File runtime/bin/directory_win.cc (right): https://codereview.chromium.org/13654002/diff/16001/runtime/bin/directory_win.cc#newcode433 runtime/bin/directory_win.cc:433: errno = ENOTDIR; I don't this this works. ...
7 years, 8 months ago (2013-04-08 07:21:18 UTC) #4
Anders Johnsen
Ty, landing. https://codereview.chromium.org/13654002/diff/16001/runtime/bin/directory_win.cc File runtime/bin/directory_win.cc (right): https://codereview.chromium.org/13654002/diff/16001/runtime/bin/directory_win.cc#newcode433 runtime/bin/directory_win.cc:433: errno = ENOTDIR; On 2013/04/08 07:21:18, Søren ...
7 years, 8 months ago (2013-04-08 07:44:04 UTC) #5
Anders Johnsen
Committed patchset #7 manually as r21045 (presubmit successful).
7 years, 8 months ago (2013-04-08 07:44:39 UTC) #6
Bill Hesse
LGTM. https://codereview.chromium.org/13654002/diff/23001/runtime/bin/file_win.cc File runtime/bin/file_win.cc (right): https://codereview.chromium.org/13654002/diff/23001/runtime/bin/file_win.cc#newcode279 runtime/bin/file_win.cc:279: free(const_cast<wchar_t*>(system_name)); I think there is a problem calling ...
7 years, 8 months ago (2013-04-08 12:16:33 UTC) #7
Anders Johnsen
7 years, 8 months ago (2013-04-08 12:22:33 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/13654002/diff/23001/runtime/bin/file_win.cc
File runtime/bin/file_win.cc (right):

https://codereview.chromium.org/13654002/diff/23001/runtime/bin/file_win.cc#n...
runtime/bin/file_win.cc:279: free(const_cast<wchar_t*>(system_name));
On 2013/04/08 12:16:33, Bill Hesse wrote:
> I think there is a problem calling "free" between an implicit or explicit
> SetLastError, and the GetLastError after the function returns.  See line 333
for
> how we wrap a call to free elsewhere.

Can you link me some info on the problem? I'm not sure what the problem should
be. (it would render any stack-allocated c++ classes dangerous?)

https://codereview.chromium.org/13654002/diff/23001/runtime/bin/file_win.cc#n...
runtime/bin/file_win.cc:506: CloseHandle(dir_handle);
On 2013/04/08 12:16:33, Bill Hesse wrote:
> Since we have the handle to the file, and this might be a symbolic link,
rather
> than a junction, should we check the attributes for file or directory (or even
> the original "attributes" field), and report file or directory here?  Since we
> don't support creating symbolic links, we couldn't test this.

I understand now. Yes, we should probably add that back.

Powered by Google App Engine
This is Rietveld 408576698