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

Unified Diff: packages/which/lib/src/is_executable.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/which/lib/src/has_permission.dart ('k') | packages/which/lib/src/util.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/which/lib/src/is_executable.dart
diff --git a/packages/which/lib/src/is_executable.dart b/packages/which/lib/src/is_executable.dart
deleted file mode 100755
index 02fb83421ce1c0fa17cb05ea78d411eec56c5101..0000000000000000000000000000000000000000
--- a/packages/which/lib/src/is_executable.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-
-library which.src.is_executable;
-
-import 'dart:async';
-import 'dart:io';
-
-import 'package:when/when.dart';
-
-import 'has_permission.dart';
-
-Future<bool> isExecutable(String path, bool isWindows, Future<FileStat> getStat(path)) =>
- _isExecutable(path, isWindows, getStat);
-
-bool isExecutableSync(String path, bool isWindows, FileStat getStat(path)) =>
- _isExecutable(path, isWindows, getStat);
-
-_isExecutable(String path, bool isWindows, getStat(path)) =>
- when(() => getStat(path), onSuccess: (stat) => isExecutableStat(stat, isWindows));
-
-/// Tests whether the file exists and is executable.
-bool isExecutableStat(FileStat stat, bool isWindows) {
- if (FileSystemEntityType.FILE != stat.type) return false;
-
- // There is no concept of executable on windows.
- if (isWindows) return true;
-
- // TODO: This currently produces false positives (returns true when it
- // shouldn't) when the uid/gid of current user and executable don't
- // match. Fix if/when uid/gid support is added:
- // http://dartbug.com/22037.
- return FilePermissionRole.values.any((role) =>
- hasPermission(stat.mode, FilePermission.EXECUTE, role: role));
-}
« no previous file with comments | « packages/which/lib/src/has_permission.dart ('k') | packages/which/lib/src/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698