home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / steward8.zip / UnLock.cmd < prev   
OS/2 REXX Batch file  |  1996-04-03  |  492b  |  30 lines

  1. /* ------------------------------------------------------------------ */
  2. /*
  3.  * UnLock
  4.  *
  5.  * Unlock a file.
  6.  *
  7.  */
  8.  
  9. TRUE = 1
  10. FALSE = 0
  11.  
  12. UnLock: 
  13.  
  14. parse arg FileName
  15.  
  16. /* first close the lock file */
  17. LockName = FileName.'lock'
  18. rc = stream(LockName, 'C', 'CLOSE')
  19.  
  20. parse var rc state ':' code
  21. if state = 'NOTREADY' then
  22.   return FALSE
  23.  
  24. /* Delete the lock file */
  25. call RxFuncAdd 'SysFileDelete', 'RexxUtil', 'SysFileDelete'
  26. rc = SysFileDelete(LockName);
  27.  
  28. return TRUE
  29.  
  30.