Solved

How to check via LotusScript if the current user has access to a specified drive and path ?

Posted on 2008-06-11
2
2,242 Views
Last Modified: 2013-12-18
Hi All,

I need to check with LotusScript if the current user has access to a specified path before contninuing the run of the script.
For example : by checking if he can access this directory "R:\OPS\ABC\Teams\Dev\IDN" and subdirectories.
How can I do that ?
Thanx for any help.
0
Comment
Question by:giggina
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
CRAK earned 300 total points
ID: 21763109
You could use Dir to check if the dir is available/accessible to the user.
If the user is supposed to read a file, consequently try that. If he/she needs to write a file, give that a try. If you're unfamiliar with that, check designer help on "Open".
Do all that in a separate function with built-in error trapping (on error goto..). Return e.g. true if all went well, or false when not.
0
 
LVL 7

Assisted Solution

by:olaraak
olaraak earned 200 total points
ID: 21764218
Yes, Run-time errors give plenty of information about failed file operations, for example:

File not found
Bad file mode
File already open
Device I/O error
File already exists
Bad record length
Disk full
Bad file name
Device unavailable
Permission denied
Disk not ready
Cannot rename with different drive
Path/file access error
Path not found
File not writable
File not readable
Illegal file number
File not open
Unable to open file
Illegal operation for file mode

... and others.

You can also set different error handling routes, depending on error code, to take specific actions.


Function DoSomethingWithFile()
 ' Error trapping
 On Error Goto catch
 
   ' ---
   ' File-handling code
   ' ---
 
  Exit Function ' To avoid error message during normal execution
catch:
  Print "Error in Function ""DoSomethingWithFile"": "  & Str(Err) & " " & Error$ & " on row " & Cstr(Erl)
  Exit Function
End Function

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question