I got an alternative way of seeing if a path is a directory from another forum which works, and a 1-liner to see if the path is readonly which I can't get working through frontCall.
It has to be double quotes round the 'r', not single, and I think that's the problem. I've tried single quotes round the command and various ways of escaping the double quotes so far to no avail. Obviously it needs to use 'exit 0' and 'exit 1' in place of 'echo readonly' and 'echo writeable'. I've taken out the 'at' signs which aren't needed for frontCall.
The code as given:
As build into a string for frontCall with single quotes round the command and double quotes round the 'r':
let l_cmd = SFMT( 'cmd /c ''for %%A in (%1) do echo %%~aA|find /i "r">nul&&(exit 1)||(exit 0)''', p_path)
display l_cmd
call ui.Interface.frontCall( "standard", "execute", [l_cmd, 1], [l_bool])
if l_bool then
display " writeable"
else
display " readonly"
end if
As run, it gives readonly regardless of if I give it a readonly or a writable path:
cmd /c 'for %A in (E:\Users\sallyw\Downloads\test1) do echo %~aA|find /i "r">nul&&(exit 1)||(exit 0)'
readonly