/** * This unlocks a locked file pointer. * * @access public * @param string $filename The filename that was opened * @param string $mode Mode the file was opened in * @return mixed PEAR Error on error, true otherwise */ function unlock($filename, $mode) { if (!PEAR::isError($fp =& FILE::_getFilePointer($filename, $mode))) { return flock($fp, LOCK_UN) ? true : PEAR::raiseError('Failed to unlock file: ' . $filename); } return $fp; }