When Is A Drive Really Read Only?
- Posted by euphoric (admin) Oct 04, 2018
- 1163 views
I have a user who says my app is saying his access to a folder is blocked (read only). However, he can use Notepad to create files in that same folder.
Am I determining read/write status improperly? Here's my code:
public function write_to_path(sequence p) integer res = 0 dp("write access to '" & p & "'") object d = dir(p) if sequence(d) then -- dp(sprintf("ATTRIBUTES: %s", { d[1][D_ATTRIBUTES] })) res = find('d', d[1][D_ATTRIBUTES]) and not find('r',d[1][D_ATTRIBUTES]) end if if res then dp("...Allowed!",{}) else dp("...Denied!",{}) end if return res end function
dp() is just a debug printing function.
This is for Windows OS-based PCs.
Any help appreciated!