Unlock directory by deleting lock file.
501622
public function unlock()
    {
        $dir = $this->getDir();

        if ($this->filesystem->exists($dir . '.lock')) {
            $this->filesystem->remove($dir . '.lock');
        }
    }
56124
def remove_tmp_dir(self, directory):
        
        if(not directory.startswith('/tmp/')):
            print('Directory not in /tmp')
            exit()

        print('Deleting directory: ' + directory)

        shutil.rmtree(directory)
964960
def release(self):
        
        if self._lock_fd is not None:
            os.close(self._lock_fd)
            try:
                os.remove(self._lock_filename)
            except OSError:
                # Hmm, someone deleted our lock while we had it locked?
                # Nothing we can do, so just continue
                pass
1090803
def cleanup(self):
        """"""
        shutil.rmtree(self.name, onerror=lambda *a: os.chmod(a[1], __import__('stat').S_IWRITE) or os.unlink(a[1]))
        if os.path.exists(self.name):
            raise IOError(17, "File exists: '{}'".format(self.name))
425408
public void release() {
        if (lock != null) {
            try {
                lock.release();
                lock = null;
            } catch (IOException ex) {
                LOGGER.debug("Failed to release lock", ex);
            }
        }
        if (file != null) {
            try {
                file.close();
                file = null;
            } catch (IOException ex) {
                LOGGER.debug("Unable to delete lock file", ex);
            }
        }
        if (lockFile != null && lockFile.isFile()) {
            final String msg = readLockFile();
            if (msg != null && msg.equals(magic) && !lockFile.delete()) {
                LOGGER.error("Lock file '{}' was unable to be deleted. Please manually delete this file.", lockFile.toString());
                lockFile.deleteOnExit();
            }
        }
        lockFile = null;
        removeShutdownHook();
        final Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        LOGGER.debug("Lock released ({}) {} @ {}", Thread.currentThread().getName(), magic, timestamp.toString());
    }
798549
def _delete_dir(self):
        
        if not self.auto and os.path.isdir(self.meta.build_path + self.prgnam):
            shutil.rmtree(self.meta.build_path + self.prgnam)
878424
public void unlock() {

        for (Locale l : m_lockedBundleFiles.keySet()) {
            LockedFile f = m_lockedBundleFiles.get(l);
            f.tryUnlock();
        }
        if (null != m_descFile) {
            m_descFile.tryUnlock();
        }
    }
1117472
def release(self):
        """"""
        if not self.acquired:
            raise threading.ThreadError("Unable to release an unacquired"
                                        " lock")
        try:
            self.unlock()
        except IOError:
            self.logger.exception("Could not unlock the acquired lock opened"
                                  " on `%s`", self.path)
        else:
            self.acquired = False
            try:
                self._do_close()
            except IOError:
                self.logger.exception("Could not close the file handle"
                                      " opened on `%s`", self.path)
            else:
                self.logger.log(_utils.BLATHER,
                                "Unlocked and closed file lock open on"
                                " `%s`", self.path)
169516
def forced_unlock
      @file = nil
      if File.exist?(@file_name)
        begin
          File.delete(@file_name)
          PEROBS.log.debug "Lock file #{@file_name} has been deleted."
        rescue IOError => e
          PEROBS.log.error "Cannot delete lock file #{@file_name}: " +
            e.message
        end
      end
    end
778760
def delete(self):
        """"""
        self._ensure_filename()
        self._close_if_open()
        os.remove(self.filename)
1331481
def remove_directory(directory, show_warnings=True):
    """"""
    errors = []

    def onerror(function, path, excinfo):
        if show_warnings:
            print 'Cannot delete %s: %s' % (os.path.relpath(directory), excinfo[1])
        errors.append((function, path, excinfo))

    if os.path.exists(directory):
        if not os.path.isdir(directory):
            raise NotADirectoryError(directory)
        shutil.rmtree(directory, onerror=onerror)

    return errors
1313574
public function delete_lockfile() {
		$retval = false;
		try {
			if($this->is_lockfile_present()) {
				$retval = $this->fsObj->rm($this->get_lockfile());
			}
		}
		catch (Exception $e) {
			$retval = false;
		}
		
		return($retval);
	}
1028240
def remove_program_temp_directory():
    """"""
    if os.path.exists(program_temp_directory):
        max_retries = 3
        curr_retries = 0
        time_between_retries = 1
        while True:
            try:
                shutil.rmtree(program_temp_directory)
                break
            except IOError:
                curr_retries += 1
                if curr_retries > max_retries:
                    raise # re-raise the exception
                time.sleep(time_between_retries)
            except:
                print("Cleaning up temp dir...", file=sys.stderr)
                raise
151369
def clear_lock(self, abspath=True):
        """"""
        cmd_list = ['clean', '--lock', '--json']
        return self._call_and_parse(cmd_list, abspath=abspath)
1063054
def clear_dir(self):
        """"""
        self.stdout.write("Deleting contents of '{}'.".format(self.destination_path))

        for filename in os.listdir(self.destination_path):
            if os.path.isfile(filename) or os.path.islink(filename):
                os.remove(filename)
            elif os.path.isdir(filename):
                shutil.rmtree(filename)
1358358
def delete_file(self, name):
        
        if self.local_store:
            lock = self.lock_manager.lock_for(name)
            lock.lock_exclusive()
            try:
                self.local_store.delete_file(name)
            finally:
                lock.close()
        if self.remote_store:
            self.remote_store.delete_file(name)
350450
def clean_cache(self, section=None):
        """"""
        self.remove_all_locks()
        if section is not None and "/" in section:
            raise ValueError("invalid section '{0}'".format(section))
        if section is not None:
            path = os.path.join(self._full_base, section)
        else:
            path = self._full_base
        if not os.path.exists(path):
            return
        shutil.rmtree(path)