Inconsistent statSync().mode
Behavior: Fails to Differentiate Between Non-Existent and Permission-Denied Files
#57111
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-io
type-enhancement
A request for a change that isn't a bug
Currently, the
statSync().mode
API in Dart has inconsistent behavior when dealing with non-existent files and files with restricted permissions:Expected Behavior:
An exception should be thrown for non-existent files to distinguish them from files with restricted permissions.
Actual Behavior:
Both scenarios return 0 from
statSync().mode
, which can lead to incorrect assumptions in applications.The text was updated successfully, but these errors were encountered: