Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Security Issue
Message
 
 
To
11/07/2000 16:32:44
Liam O'Hagan
O'Hagan Programming Ltd
Ireland
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00390933
Message ID:
00390961
Views:
8
An extension of this idea is to use FCREATE() to create a temporary file and delete it. This approach tests for read/write/delete access.
lnfile = addbs(mypath)+sys(3)+".txt"
lnh = fcreate(lnfile)
if lnh > 0 then
   * directory exists and you have creation rights
   =fclose(lnh)
   delete file (lnfile)
   if file(lnfile) then
      * you have creation rights but you can't delete anything
      * make a choice as to what to do
   else
      * everything is OK
   endif
else
   * directory does not exist or you don't have access to it
endif
>Hi Pamela,
>
>A quick and dirty solution would be to try and write a few bytes to a dummy file in that directory. Test for the existence of the file and if it's there then the user has write permission.
>
>HTH
>
>Liam
>
>
>
>
>
>>I have a program that I am allowing the user to choose the path that their specific department information resides. Is there a way to verify that the user has security to the chosen directory? If they do not, display a message prompting the user to choose another directory? I want to catch it at this point. . . not when the user tries to access a table within the directory.
>>
>>Thanks in advance for your assistance.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform