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,218 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 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