You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: acquireLock.m
    path of file: ./repos/Image-Harmonization-Dataset-iHarmony4/Lalonde and Efros/utils/mycode/database
    
    the code of the file until where you have to start completion: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function [gotLock, lockFile] = acquireLock(outputBasePath, folder, filename)
%  Obtains a lock file for a given file and folder. the gotLock variable indicates if the
    
function [gotLock, lockFile] = acquireLock(outputBasePath, folder, filename)
%  Obtains a lock file for a given file and folder. the gotLock variable indicates if the lock was
%  obtained successfully or if another process already got it.
% 
% Input parameters:
%   - outputBasePath: 
%
% Output parameters:
%   
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [gotLock, lockFile] = acquireLock(outputBasePath, folder, filename)
global lockAppend