there is no api to test for attributes (like canRead/canWrite/isHidden/etc). You could cast your vote here:
do runtime error check with try/catch or by listening to appropriate error events that can be broadcasted by given operation (move/copy or write etc). If I'm not wrong there is runtime specific error for media which is read-only.
We have to check for runtime errors as "read/write" of directory is not exactly the same if application has appropriate privileges to do I/O operation with given directory.
when you try to "open" FileStream for "WRITE" on in synchronous mode (so not openAsync) it will throw immediate runtime error when application cannot open filestream for "WRITE" mode:
I don't think that is recommended way to test-by-action if directory is writable - but would work anyway if you're implementing writing feature into selected directory
you could asynchronously use NativeProcess to run system shell functions:
ls -lo <YOUR_PATH_HERE_QUOTED_IF_REQUIRED>
to see what are attributes of path selected by user. This data would arrive asynchronously and would require you to parse it as it arrives in format like:
rwxr-xr-x@ 3 $USER staff 102 Jun 5 12:38 /opt
(related api for Windows is ATTRIB)
Thanks a lot for your great and detailed answer. NativeProcess sound great !