anchor.diff:               throwsToolExit(message: expectedMessage));
       });
   
  -    testWithoutContext('When reading from a file or directory without permission', () {
  -      setupReadMocks(
  -        mockFileSystem: mockFileSystem,
  -        fs: fs,
  -        errorCode: kUserPermissionDenied,
  -      );
  -
  -      final File file = fs.file('file');
  +    testWithoutContext('When reading from a file without permission', () {
  +       final ErrorHandlingFileSystem fileSystem = ErrorHandlingFileSystem(
  +        delegate: MemoryFileSystem.test(opHandle: exceptionHandler.opHandle),
  +        platform: windowsPlatform,
  +      );
  +      final File file = fileSystem.file('file');
  +
  +      exceptionHandler.addError(
  +        file,
  +        FileSystemOp.read,
  +        FileSystemException('', file.path, const OSError('', kUserPermissionDenied)),
  +      );
   
         const String expectedMessage = 'Flutter failed to read a file at';
         expect(() => file.readAsStringSync(),
                throwsToolExit(message: expectedMessage));
  -      expect(() => fs.currentDirectory,
  +    });
  +
  +    testWithoutContext('When reading from a file or directory without permission', () {
  +       final ErrorHandlingFileSystem fileSystem = ErrorHandlingFileSystem(
  +        delegate: ThrowsOnCurrentDirectoryFileSystem()..errorCode = kUserPermissionDenied,
  +        platform: windowsPlatform,
  +      );
  +
  +      expect(() => fileSystem.currentDirectory,
                throwsToolExit(message: 'The flutter tool cannot access the file or directory'));
       });
     });
  
positive.code:              throwsToolExit(message: expectedMessage));
      });
  
      testWithoutContext('When reading from a file or directory without permission', () {
        setupReadMocks(
          mockFileSystem: mockFileSystem,
          fs: fs,
          errorCode: eacces,
        );
  
        final File file = fs.file('file');
  
        const String expectedMessage = 'Flutter failed to read a file at';
        expect(() => file.readAsStringSync(),
               throwsToolExit(message: expectedMessage));
        expect(() => fs.currentDirectory,
               throwsToolExit(message: 'The flutter tool cannot access the file or directory'));
      });
    });
  
negative.code:   operatingSystem: 'macos',
    environment: <String, String>{}
  );
  
  void setupDirectoryMocks({
    FileSystem mockFileSystem,
  