Check directory permissions

  • Thread starter Thread starter Dave T
  • Start date Start date
D

Dave T

I've got a little script which needs to put it's output in a user-
specified directory and I'd like to make sure that the user has
permission to write to the directory before letting the script try.

I've seen some posts which suggest trying to write a file to the
directory first, while other suggested using GetAtrr(). GetAtrr()
only seems to want to tell me that the specified directory is in fact
a directory.

Is there a simple way to check that the user has write permissions or
am I better off try to write a file and trapping that error?
 
Why not just check for an error after they (try to) save the file--why bother
with the test file?
 
When the initial dialogue that let's them select their output
directory comes up I'd like it to warn them immedeately if they picked
a directory that they shouldn't have.
The script is producing a few hundred little text files, and I'd like
it to be more "fire-and-forget". So if there is something quick and
easy, I'd rather do that at the start than have to trap an error and
force the user to pay attention after the setup.
 
Then I'd test it with a testfile.



Dave said:
When the initial dialogue that let's them select their output
directory comes up I'd like it to warn them immedeately if they picked
a directory that they shouldn't have.
The script is producing a few hundred little text files, and I'd like
it to be more "fire-and-forget". So if there is something quick and
easy, I'd rather do that at the start than have to trap an error and
force the user to pay attention after the setup.
 
Back
Top