OLD | NEW |
1 | 1 |
2 library which.src.is_executable; | 2 library which.src.is_executable; |
3 | 3 |
4 import 'dart:async'; | 4 import 'dart:async'; |
5 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'package:when/when.dart'; | 7 import 'package:when/when.dart'; |
8 | 8 |
9 import 'has_permission.dart'; | 9 import 'has_permission.dart'; |
10 | 10 |
(...skipping 13 matching lines...) Loading... |
24 // There is no concept of executable on windows. | 24 // There is no concept of executable on windows. |
25 if (isWindows) return true; | 25 if (isWindows) return true; |
26 | 26 |
27 // TODO: This currently produces false positives (returns true when it | 27 // TODO: This currently produces false positives (returns true when it |
28 // shouldn't) when the uid/gid of current user and executable don't | 28 // shouldn't) when the uid/gid of current user and executable don't |
29 // match. Fix if/when uid/gid support is added: | 29 // match. Fix if/when uid/gid support is added: |
30 // http://dartbug.com/22037. | 30 // http://dartbug.com/22037. |
31 return FilePermissionRole.values.any((role) => | 31 return FilePermissionRole.values.any((role) => |
32 hasPermission(stat.mode, FilePermission.EXECUTE, role: role)); | 32 hasPermission(stat.mode, FilePermission.EXECUTE, role: role)); |
33 } | 33 } |
OLD | NEW |