• Try to rename .nsX file that is currently locked fails

    By Stefan Johannsen 2 decades ago

    Hallo,



    When I try to create a release the programm creates an .ns4, .ns5 or .ns6 file.

    The CreateTemplate function in the Version Control Lirbary calls the Name statement to remane .nsX files to .ntf.

    Occured error: "Permission denied"

    The .nsX file is locked until exit Lotus Notes.



    Are there any solutions?



    hopefully

    Stefan Johannsen

    • Solution!

      By Martin Pichler 2 decades ago

      The problem is the line "Call DBCopy.GrantAccess ("-Default-" , 6)"…



      The file gets locked - add the following line straight after it (before i=0) that to get it work:



      Call dbcopy.ACL.save



      When i did that - it worked!!!



      Seems the GrantAccess method locks it and saving the ACL before doing any other changes resolves the problem… Not a big solution - but it helps…

      • Not for me

        By Bruce Langner 2 decades ago

        I found the line you were referring to in the "processACL" function and added the call to save the ACL however it did not help. Permission was still denied.



        The only work around I have creates a template file from the original, NOT from the recently made '.nsX' file:



        Dim tmpStr As String

        tmpStr = Strleft (FileName , ".ns" )

        'Name FileName As Strleft (FileName , ".ns" ) + ".ntf"

        'Name FileName As tmpStr + ".ntf"

        Set DBCopy = ProcessedDB.CreateCopy( "", tmpStr + ".ntf")

        DBCopy.Title = DBCopy.Title + " Template " + ReleaseNumber



        This is not satisfactory if I actually want an R4, R5 or R6 template. In which case I need to do it manually from the 'nsX' file once it is created. With the above I am at least getting version control stored zip files.



        The error occurs because something has generated a file handle on the 'nsX' file and has subsequently not let go. Even to delete the generated 'nsX' file I have to shut Windows File Explorer and Lotus Notes and then re-open them.

      • Work Around

        By Bruce Langner 2 decades ago

        You need to add the line that Martin indicates:



        Call DBCopy.GrantAccess ("-Default-" , 6)

        Call DBCopy.ACL.Save ' <—- add this line

        i = 0



        into the processACL function of the Version Control script library.



        I was then able to get the process working if I did NOT select 'Brand Design' and consequently 'Include Version Agent'. Do NOT select 'Sign Database' either, this will also cause the Permission Denied error. Select ONLY 'Embed Files in Release Document' to consistently avoid the error and get the useful version control functionality.