Flutter widget test error: OS Error: Read-only file system, errno = 30 - flutter

when I use “flutter run xxx_test.dart”, I got an error:
I/flutter (15574): The following FileSystemException was thrown
running a test:
I/flutter (15574): Creation failed, path = '//.test' (OS Error:
Read-only file system, errno = 30)
since I call function:
dir.createSync(recursive: true);
how to resolve it? thx

Related

Oops; flutter has exited unexpectedly: errno = 32

Oops; flutter has exited unexpectedly: "FileSystemException: Deletion failed, path =
'D:\otp.android' (OS Error: The program cannot access the file because it is being used by another program.
, errno = 32)".
How to solve this problem ?
How to solve this problem ?

Gallery saver catches (OS Error: File name too long, errno = 36))

I'm trying to save an image to the Android gallery and catch this exception:
FileSystemException (FileSystemException: Cannot open file, path = '/data/user/0/...' (OS Error: File name too long, errno = 36)).
How to solve this problem?

How to read files outside the project's directory

I'm new to flutter,I want to read some files outide the directory of my flutter project,let's say a file located in Desktop folder
here's how I tried
Future<File> _getLocalFile() async {
return File('/Users/xxx/Desktop/test.txt');
}
then I got this error
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FileSystemException: Cannot open file, path = '/Users/xxx/Desktop/test.txt' (OS Error: Operation not permitted, errno = 1)
Is there any way I can get the permission to deal with such files?

OS Error: Access is denied. , errno = 5 in flutter

`Target debug_android_application failed: FileSystemException: Cannot copy file to 'C:\Users\TITYA\flutter_udemy_four\build\app\intermediates\flutter\debug\flutter_assets\assets\food.jpg', path = 'C:\Users\TITYA\flutter_udemy_four\assets\food.jpg' (OS Error: Access is denied.
, errno = 5)
Please help me to solve this problem. Thank`
Run the command you are using in as an admin terminal

"FileSystemException: Cannot open file, path = 'C:\Users\flutter\bin\cache\lockfile' (OS Error: Access is denied

"FileSystemException: Cannot open file, path = 'C:\Users\flutter\bin\cache\lockfile' (OS Error: Access is denied.
This message occurred while flutter doctor command.