I'm using File_Test to check if the current user has write permissions to a folder. When I check using File_Test(path,/write) I get a 1 indicating yes. I get the equivalent result with File_Info.
print, file_Test('C:\Program Files\ITT\IDL64\products\envi44\spec_lib\jhu_lib',/write)
1
When I execute File_mkdir(child_path), my program crashes.
file_mkdir,'C:\Program Files\ITT\IDL64\products\envi44\spec_lib\jhu_lib\sli_lib
FILE_MKDIR: Unable to create directory: C:\Program Files\ITT\IDL64\products\envi44\spec_lib\jhu_lib\sli_lib, Permission denied.
Is this a bug with IDL or am I missing something? When I check the Windows permissions, there are power users and standard users. I'm running as a standard user and therefore do not have write permissions so I need to check this to prevent a crash.
Someone suggested I use a spawn call to DOS to write a file and then check to see if it is there. If it is not, then the user does not have permission. Is there a better option?
|