On Feb 23, 2006, at 10:19 AM, [EMAIL PROTECTED] wrote:

Actually one of the "features" of my program is that its highly
transportable. I have the program and a "settings" folder in an overall folder. And the user can transport that to a thumb drive and take it to home or office. I have also noticed, that it makes installation a breeze - even on our high security Windows network (1000 users) - it seems that copying the app to the hard disk passes under the radar of the security system. Luckily I am not trying to do any mischief. And if not for this, then no one would be able to install the software without having someone from Computer Support there to authorize it.

OK, that makes sense.

I guess that you just need to add some code to test if the file is locked before you open it. Something like this:

Function UnlockFile(Extends f As FolderItem) As Boolean
  If (f Is Nil) Or (Not f.Exists) Then Return
  If f.Locked Then f.Locked = False
  If f.Locked Or (f.LastErrorCode > 0) Then
    Return False
  Else
    Return True
  End If
End Function

Then you can do something like this:

  If f.UnlockFile Then
    b = f.OpenAsBinaryStream
    // continue processing file
  Else
MsgBox "Unable to open files located on a locked device. If the application is being run from a CD, please copy the file to the hard drive before executing. If the application is already on the hard drive, please contact the system administrator to allow read/write access to this directory."
    Quit
  End If
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to