Deletes the specified file. Opening it up again re-creates it.
545359
public void deleteFile(long id) throws IOException {
        if (id >= getFileCount()) {
            return;
        }

        Long key = new Long(id);
        InternalFile file = openInternal(key);

        // Acquire write lock on file to delete before acquiring lock on
        // file table. This ensures a consistent lock order with all other
        // operations and prevents deadlock. Operations on internal files
        // will first lock the internal file, and then lock the shared file
        // table when necessary.
        try {
            file.lock().acquireWriteLock();
            // Use the file table lock to prevent multiple threads from using
            // mOpenFiles.
            try {
                mFileTableLock.acquireWriteLock();
                file.delete();
                mOpenFiles.remove(key);
            }
            finally {
                mFileTableLock.releaseLock();
            }
        }
        catch (InterruptedException e) {
            throw new InterruptedIOException();
        }
        finally {
            file.lock().releaseLock();
        }
    }
725857
def delete_file(self, path):
        
        self.log.debug("S3contents.GenericManager: delete_file '%s'", path)
        if self.file_exists(path) or self.dir_exists(path):
            self.fs.rm(path)
        else:
            self.no_such_entity(path)
459351
public static void deleteFile(@Nullable File file) throws IOException {
		Validate.isTrue(isFileExists(file), "%s is not exist or not a file", file);
		deleteFile(file.toPath());
	}
584407
public static void deleteFile(@NonNull File file) {
    boolean deleted = file.delete();
    if (!deleted) {
      Log.w(LOG_TAG, "Could not delete file: " + file);
    }
  }
1078090
def file_remove(self, path, filename):
        
        if os.path.isfile(path + filename):
            os.remove(path + filename)
29143
def delete(self):
        
        fcid = None
        pid = None

        if isinstance(self, File):
            fcid = self.fid
            pid = self.cid
        elif isinstance(self, Directory):
            fcid = self.cid
            pid = self.pid
        else:
            raise APIError('Invalid BaseFile instance.')

        if not self._deleted:
            if self.api._req_rb_delete(fcid, pid):
                self._deleted = True
                return True
        else:
            raise APIError('This file or directory is already deleted.')
18379
public void delete() {
    try {
      Files.walkFileTree(partition.dataDirectory().toPath(), new SimpleFileVisitor<Path>() {
        @Override
        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
          Files.delete(file);
          return FileVisitResult.CONTINUE;
        }

        @Override
        public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
          Files.delete(dir);
          return FileVisitResult.CONTINUE;
        }
      });
    } catch (IOException e) {
      log.error("Failed to delete partition: {}", e);
    }
  }
996912
def delete(self, filename):
        """"""

        self._failed_atoms.clear()
        self.clear()
        self.save(filename, padding=lambda x: 0)
41787
public void delete() throws IOException, InterruptedException {
        // Access to file must be closed before deleting.
        rwfile.close();

        file.delete();

        // Wait until file has been deleted (deletes are asynchronous on Windows!) otherwise we
        // might shutdown the server and prevent another one from starting.
        for (int i = 0; i < 10 && file.exists(); i++) {
            Thread.sleep(1000);
        }
        if (file.exists()) {
            throw new IOException("Failed to delete file.");
        }
    }
74223
def delete(self):
        
        if os.path.isfile(self.path):
            os.remove(self.path)
        else:
            shutil.rmtree(self.path)
978942
def delete_from_file(file_path)
      client_setup
      resource = OneviewSDK::Resource.from_file(@client, file_path)
      fail_nice("#{resource.class.name.split('::').last} '#{resource[:name] || resource[:uri]}' Not Found", 2) unless resource.retrieve!
      return unless options['force'] || agree("Delete '#{resource[:name]}'? [Y/N] ")
      begin
        resource.delete
        puts 'Deleted Successfully!'
      rescue StandardError => e
        fail_nice "Failed to delete #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
      end
    rescue IncompleteResource => e
      fail_nice "Failed to delete #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
    rescue SystemCallError => e # File open errors
      fail_nice e
    end
1372986
public synchronized void delete() {
		try {
			clear();
		} catch (Exception ign) {
		}
		try {
			close();
		} catch (Exception ign) {
		}
		try {
			fileRedo.delete();
		} catch (Exception ign) {
		}
		try {
			fileStorage.delete();
		} catch (Exception ign) {
		}
		try {
			fileFreeBlocks.delete();
		} catch (Exception ign) {
		}
	}
432747
def delete(self, file_, delete_file=True):
        
        image_file = ImageFile(file_)
        if delete_file:
            image_file.delete()
        default.kvstore.delete(image_file)
949756
public void delete(String fileName) {
		try {
			synchronized (prepareAnchor(fileName)) {
				// Close file, if it was opened
				IoChannel fileChannel = openFiles.remove(fileName);
				if (fileChannel != null)
					fileChannel.close();

				// Delete the file
				boolean hasDeleted = new File(dbDirectory, fileName).delete();
				if (!hasDeleted && logger.isLoggable(Level.WARNING))
					logger.warning("cannot delete file: " + fileName);
			}
		} catch (IOException e) {
			if (logger.isLoggable(Level.WARNING))
				logger.warning("there is something wrong when deleting " + fileName);
			e.printStackTrace();
		}
	}
1077491
public void delete() throws IOException {
    close();
    if (osFile != null) {
      boolean deleted = osFile.delete();
      while (!deleted) {
        OMemoryWatchDog.freeMemory(100);
        deleted = osFile.delete();
      }
    }
  }
458465
def delete(self):
        

        directory = self._directory()
        assert isinstance(directory, Directory)

        realPath = self.realPath
        assert (os.path.exists(realPath))
        os.remove(realPath)

        directory._fileDeleted(self)
64247
def delete_file(self, uri, purge=False):
        
        try:
            resource = self.get_resource_by_uri(uri)
        except ResourceNotFoundError:
            # Nothing to remove
            return None

        if not isinstance(resource, File):
            raise ValueError("File expected, got {}".format(type(resource)))

        if purge:
            func = self.api.file_purge
        else:
            func = self.api.file_delete

        return func(resource['quickkey'])