-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotriagedIssue has been triaged by sub teamIssue has been triaged by sub teamtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Currently, the statSync().mode API in Dart has inconsistent behavior when dealing with non-existent files and files with restricted permissions:
touch MyFile
chmod 000 ./MyFilevar mode = File("MyFile").statSync().mode; // Returns 0 as expected (no permissions). var mode = File("notExistingFile").statSync().mode;
// Also returns 0, which is misleading because the file does not exist.
// Ideally, it should throw an exception to differentiate this case. 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.
Metadata
Metadata
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-iotriagedIssue has been triaged by sub teamIssue has been triaged by sub teamtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug